summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-31 13:33:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-31 13:33:02 +0000
commit514d9bad9efd584d9dd70aca2b1c27128c2f0eca (patch)
treef7e88d67054fa130b3849222c68102ca6c4934d9 /test/integration
parentf2bf5aa25c482eb48d24135a19cb6f4455bf263f (diff)
downloadredmine-514d9bad9efd584d9dd70aca2b1c27128c2f0eca.tar.gz
redmine-514d9bad9efd584d9dd70aca2b1c27128c2f0eca.zip
Fixed that project settings should show locked members (#22034).
git-svn-id: http://svn.redmine.org/redmine/trunk@16116 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/memberships_test.rb34
1 files changed, 20 insertions, 14 deletions
diff --git a/test/integration/api_test/memberships_test.rb b/test/integration/api_test/memberships_test.rb
index 92d4b094c..dd259839d 100644
--- a/test/integration/api_test/memberships_test.rb
+++ b/test/integration/api_test/memberships_test.rb
@@ -37,20 +37,17 @@ class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base
assert_response :success
assert_equal 'application/json', @response.content_type
json = ActiveSupport::JSON.decode(response.body)
- assert_equal({
- "memberships" =>
- [{"id"=>1,
- "project" => {"name"=>"eCookbook", "id"=>1},
- "roles" => [{"name"=>"Manager", "id"=>1}],
- "user" => {"name"=>"John Smith", "id"=>2}},
- {"id"=>2,
- "project" => {"name"=>"eCookbook", "id"=>1},
- "roles" => [{"name"=>"Developer", "id"=>2}],
- "user" => {"name"=>"Dave Lopper", "id"=>3}}],
- "limit" => 25,
- "total_count" => 2,
- "offset" => 0},
- json)
+ assert_equal 3, json["total_count"]
+ assert_equal 25, json["limit"]
+ assert_equal 0, json["offset"]
+ assert_include({
+ "id"=>1,
+ "project" => {"name"=>"eCookbook", "id"=>1},
+ "roles" => [{"name"=>"Manager", "id"=>1}],
+ "user" => {"name"=>"John Smith", "id"=>2}
+ },
+ json["memberships"]
+ )
end
test "GET /projects/:project_id/memberships.xml should succeed for closed project" do
@@ -61,6 +58,15 @@ class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base
assert_response :success
end
+ test "GET /projects/:project_id/memberships.xml should include locked users" do
+ assert User.find(3).lock!
+ get '/projects/ecookbook/memberships.xml', {}, credentials('jsmith')
+ assert_response :success
+ assert_select 'memberships[type=array] membership id', :text => '2' do
+ assert_select '~ user[id="3"][name="Dave Lopper"]'
+ end
+ end
+
test "POST /projects/:project_id/memberships.xml should create the membership" do
assert_difference 'Member.count' do
post '/projects/1/memberships.xml', {:membership => {:user_id => 7, :role_ids => [2,3]}}, credentials('jsmith')