summaryrefslogtreecommitdiffstats
path: root/test/unit/role_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-18 09:14:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-18 09:14:10 +0000
commit474c01074638e46c505dc826c0d631980093f145 (patch)
treec50732b9be6f2f3f5092b306cf356c35cc6b9719 /test/unit/role_test.rb
parent8f7b69f77e7f92d3b81c0fbd9a0a70169b4d21e9 (diff)
downloadredmine-474c01074638e46c505dc826c0d631980093f145.tar.gz
redmine-474c01074638e46c505dc826c0d631980093f145.zip
Removed some shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11864 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/role_test.rb')
-rw-r--r--test/unit/role_test.rb56
1 files changed, 20 insertions, 36 deletions
diff --git a/test/unit/role_test.rb b/test/unit/role_test.rb
index 45ad1ab1b..68f737d2a 100644
--- a/test/unit/role_test.rb
+++ b/test/unit/role_test.rb
@@ -91,55 +91,39 @@ class RoleTest < ActiveSupport::TestCase
assert_equal Role.all.reject(&:builtin?).sort, Role.find_all_givable
end
- context "#anonymous" do
- should "return the anonymous role" do
+ def test_anonymous_should_return_the_anonymous_role
+ assert_no_difference('Role.count') do
role = Role.anonymous
assert role.builtin?
assert_equal Role::BUILTIN_ANONYMOUS, role.builtin
end
+ end
+
+ def test_anonymous_with_a_missing_anonymous_role_should_return_the_anonymous_role
+ Role.where(:builtin => Role::BUILTIN_ANONYMOUS).delete_all
- context "with a missing anonymous role" do
- setup do
- Role.delete_all("builtin = #{Role::BUILTIN_ANONYMOUS}")
- end
-
- should "create a new anonymous role" do
- assert_difference('Role.count') do
- Role.anonymous
- end
- end
-
- should "return the anonymous role" do
- role = Role.anonymous
- assert role.builtin?
- assert_equal Role::BUILTIN_ANONYMOUS, role.builtin
- end
+ assert_difference('Role.count') do
+ role = Role.anonymous
+ assert role.builtin?
+ assert_equal Role::BUILTIN_ANONYMOUS, role.builtin
end
end
- context "#non_member" do
- should "return the non-member role" do
+ def test_non_member_should_return_the_non_member_role
+ assert_no_difference('Role.count') do
role = Role.non_member
assert role.builtin?
assert_equal Role::BUILTIN_NON_MEMBER, role.builtin
end
+ end
+
+ def test_non_member_with_a_missing_non_member_role_should_return_the_non_member_role
+ Role.where(:builtin => Role::BUILTIN_NON_MEMBER).delete_all
- context "with a missing non-member role" do
- setup do
- Role.delete_all("builtin = #{Role::BUILTIN_NON_MEMBER}")
- end
-
- should "create a new non-member role" do
- assert_difference('Role.count') do
- Role.non_member
- end
- end
-
- should "return the non-member role" do
- role = Role.non_member
- assert role.builtin?
- assert_equal Role::BUILTIN_NON_MEMBER, role.builtin
- end
+ assert_difference('Role.count') do
+ role = Role.non_member
+ assert role.builtin?
+ assert_equal Role::BUILTIN_NON_MEMBER, role.builtin
end
end
end