[#4177] Hooked up the project module and menu item for Contracts.
This commit is contained in:
1
app/views/contracts/index.html.erb
Normal file
1
app/views/contracts/index.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
Yay!
|
||||
8
init.rb
8
init.rb
@@ -12,8 +12,14 @@ Redmine::Plugin.register :redmine_contracts do
|
||||
requires_redmine_plugin :redmine_rate, :version_or_higher => '0.1.0'
|
||||
|
||||
project_module :contracts do
|
||||
permission :manage_budget, {}, :require => :member
|
||||
permission :manage_budget, {:contracts => [:index] }, :public => true
|
||||
end
|
||||
|
||||
menu(:project_menu,
|
||||
:contracts,
|
||||
{:controller => 'contracts', :action => 'index'},
|
||||
:caption => :text_contracts,
|
||||
:param => :project_id)
|
||||
end
|
||||
|
||||
require 'dispatcher'
|
||||
|
||||
17
test/integration/contracts_list_test.rb
Normal file
17
test/integration/contracts_list_test.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ContractsListTest < ActionController::IntegrationTest
|
||||
def setup
|
||||
@project = Project.generate!
|
||||
@contract = Contract.generate!(:project => @project)
|
||||
end
|
||||
|
||||
should "allow any user to list the contracts on a project" do
|
||||
visit_project(@project)
|
||||
click_link "Contracts"
|
||||
|
||||
assert_response :success
|
||||
assert_template 'contracts/index'
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user