diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-18 08:57:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-18 08:57:27 +0000 |
commit | 8f7b69f77e7f92d3b81c0fbd9a0a70169b4d21e9 (patch) | |
tree | 31d2955a3ce8d0e02d6327e916cdfd261fdb9081 /test/integration/api_test/roles_test.rb | |
parent | 0d4bb7558fdc955e07b69cd4015f2ecb3b5803c7 (diff) | |
download | redmine-8f7b69f77e7f92d3b81c0fbd9a0a70169b4d21e9.tar.gz redmine-8f7b69f77e7f92d3b81c0fbd9a0a70169b4d21e9.zip |
Removed some shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11863 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test/roles_test.rb')
-rw-r--r-- | test/integration/api_test/roles_test.rb | 88 |
1 files changed, 37 insertions, 51 deletions
diff --git a/test/integration/api_test/roles_test.rb b/test/integration/api_test/roles_test.rb index 87c4a9a18..5c66adbb8 100644 --- a/test/integration/api_test/roles_test.rb +++ b/test/integration/api_test/roles_test.rb @@ -24,66 +24,52 @@ class Redmine::ApiTest::RolesTest < Redmine::ApiTest::Base Setting.rest_api_enabled = '1' end - context "/roles" do - context "GET" do - context "xml" do - should "return the roles" do - get '/roles.xml' + test "GET /roles.xml should return the roles" do + get '/roles.xml' - assert_response :success - assert_equal 'application/xml', @response.content_type - assert_equal 3, assigns(:roles).size + assert_response :success + assert_equal 'application/xml', @response.content_type + assert_equal 3, assigns(:roles).size - assert_tag :tag => 'roles', - :attributes => {:type => 'array'}, - :child => { - :tag => 'role', - :child => { - :tag => 'id', - :content => '2', - :sibling => { - :tag => 'name', - :content => 'Developer' - } - } - } - end - end + assert_tag :tag => 'roles', + :attributes => {:type => 'array'}, + :child => { + :tag => 'role', + :child => { + :tag => 'id', + :content => '2', + :sibling => { + :tag => 'name', + :content => 'Developer' + } + } + } + end - context "json" do - should "return the roles" do - get '/roles.json' + test "GET /roles.json should return the roles" do + get '/roles.json' - assert_response :success - assert_equal 'application/json', @response.content_type - assert_equal 3, assigns(:roles).size + assert_response :success + assert_equal 'application/json', @response.content_type + assert_equal 3, assigns(:roles).size - json = ActiveSupport::JSON.decode(response.body) - assert_kind_of Hash, json - assert_kind_of Array, json['roles'] - assert_include({'id' => 2, 'name' => 'Developer'}, json['roles']) - end - end - end + json = ActiveSupport::JSON.decode(response.body) + assert_kind_of Hash, json + assert_kind_of Array, json['roles'] + assert_include({'id' => 2, 'name' => 'Developer'}, json['roles']) end - context "/roles/:id" do - context "GET" do - context "xml" do - should "return the role" do - get '/roles/1.xml' + test "GET /roles/:id.xml should return the role" do + get '/roles/1.xml' - assert_response :success - assert_equal 'application/xml', @response.content_type + assert_response :success + assert_equal 'application/xml', @response.content_type - assert_select 'role' do - assert_select 'name', :text => 'Manager' - assert_select 'role permissions[type=array]' do - assert_select 'permission', Role.find(1).permissions.size - assert_select 'permission', :text => 'view_issues' - end - end - end + assert_select 'role' do + assert_select 'name', :text => 'Manager' + assert_select 'role permissions[type=array]' do + assert_select 'permission', Role.find(1).permissions.size + assert_select 'permission', :text => 'view_issues' end end end |