diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-18 09:14:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-05-18 09:14:10 +0000 |
commit | 474c01074638e46c505dc826c0d631980093f145 (patch) | |
tree | c50732b9be6f2f3f5092b306cf356c35cc6b9719 /test/functional/welcome_controller_test.rb | |
parent | 8f7b69f77e7f92d3b81c0fbd9a0a70169b4d21e9 (diff) | |
download | redmine-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/functional/welcome_controller_test.rb')
-rw-r--r-- | test/functional/welcome_controller_test.rb | 74 |
1 files changed, 24 insertions, 50 deletions
diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index 94a99c223..ff4655c48 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -106,60 +106,34 @@ class WelcomeControllerTest < ActionController::TestCase end end - context "test_api_offset_and_limit" do - context "without params" do - should "return 0, 25" do - assert_equal [0, 25], @controller.api_offset_and_limit({}) - end - end - - context "with limit" do - should "return 0, limit" do - assert_equal [0, 30], @controller.api_offset_and_limit({:limit => 30}) - end - - should "not exceed 100" do - assert_equal [0, 100], @controller.api_offset_and_limit({:limit => 120}) - end + def test_api_offset_and_limit_without_params + assert_equal [0, 25], @controller.api_offset_and_limit({}) + end - should "not be negative" do - assert_equal [0, 25], @controller.api_offset_and_limit({:limit => -10}) - end - end + def test_api_offset_and_limit_with_limit + assert_equal [0, 30], @controller.api_offset_and_limit({:limit => 30}) + assert_equal [0, 100], @controller.api_offset_and_limit({:limit => 120}) + assert_equal [0, 25], @controller.api_offset_and_limit({:limit => -10}) + end - context "with offset" do - should "return offset, 25" do - assert_equal [10, 25], @controller.api_offset_and_limit({:offset => 10}) - end + def test_api_offset_and_limit_with_offset + assert_equal [10, 25], @controller.api_offset_and_limit({:offset => 10}) + assert_equal [0, 25], @controller.api_offset_and_limit({:offset => -10}) + end - should "not be negative" do - assert_equal [0, 25], @controller.api_offset_and_limit({:offset => -10}) - end + def test_api_offset_and_limit_with_offset_and_limit + assert_equal [10, 50], @controller.api_offset_and_limit({:offset => 10, :limit => 50}) + end - context "and limit" do - should "return offset, limit" do - assert_equal [10, 50], @controller.api_offset_and_limit({:offset => 10, :limit => 50}) - end - end - end + def test_api_offset_and_limit_with_page + assert_equal [0, 25], @controller.api_offset_and_limit({:page => 1}) + assert_equal [50, 25], @controller.api_offset_and_limit({:page => 3}) + assert_equal [0, 25], @controller.api_offset_and_limit({:page => 0}) + assert_equal [0, 25], @controller.api_offset_and_limit({:page => -2}) + end - context "with page" do - should "return offset, 25" do - assert_equal [0, 25], @controller.api_offset_and_limit({:page => 1}) - assert_equal [50, 25], @controller.api_offset_and_limit({:page => 3}) - end - - should "not be negative" do - assert_equal [0, 25], @controller.api_offset_and_limit({:page => 0}) - assert_equal [0, 25], @controller.api_offset_and_limit({:page => -2}) - end - - context "and limit" do - should "return offset, limit" do - assert_equal [0, 100], @controller.api_offset_and_limit({:page => 1, :limit => 100}) - assert_equal [200, 100], @controller.api_offset_and_limit({:page => 3, :limit => 100}) - end - end - end + def test_api_offset_and_limit_with_page_and_limit + assert_equal [0, 100], @controller.api_offset_and_limit({:page => 1, :limit => 100}) + assert_equal [200, 100], @controller.api_offset_and_limit({:page => 3, :limit => 100}) end end |