test/hermes/assertions_test.rb in hermes-0.5.1 vs test/hermes/assertions_test.rb in hermes-0.6.0

- old
+ new

@@ -11,11 +11,11 @@ test 'assert equal path' do assert_current_path '/users' end test 'refuse different path' do - msg = %Q(<"/not_a_valid_path"> expected but was\n<"/users">.) + msg = %Q(Expected: "/not_a_valid_path"\n Actual: "/users") assert_failure(msg) do assert_current_path '/not_a_valid_path' end end @@ -25,19 +25,18 @@ setup do visit '/users/new' end test 'assert difference exists on click button' do - fill_in :name, :with => 'User' + fill_in 'Name', :with => 'User' assert_difference_on_click_button('Submit', 'User.count') end test "refuse if difference doesn't exist" do # There's already a user in fixtures msg = "\"User.count\" didn't change by 1.\n" << - "<2> expected but was\n" << - "<1>." + "Expected: 2\n Actual: 1" assert_failure msg do assert_difference_on_click_button('Submit', 'User.count') end end @@ -51,12 +50,11 @@ assert_difference_on_click_link 'Block', 'User.blocked.count' end test "refuse if difference doesn't exist" do msg = "\"User.blocked.count\" didn't change by 1.\n" << - "<1> expected but was\n" << - "<0>." + "Expected: 1\n Actual: 0" create_user visit '/users' assert_failure msg do @@ -378,11 +376,11 @@ context "#assert_table" do test 'assert_table on success' do visit '/users/new' - assert_table "Useless Table", :rows => table_rows + assert_table "Useless Table" end test 'refuse table that does not exist' do random_content = random_string @@ -405,11 +403,11 @@ test 'refuse table that does exist' do visit '/users/new' assert_failure(/Expected to have no table/) do - assert_no_table "Useless Table", :rows => table_rows + assert_no_table "Useless Table" end end end context "#assert_mail_deliveries" do @@ -423,11 +421,11 @@ end end test 'refuse verification with different deliveries' do msg = %Q("ActionMailer::Base.deliveries.size" didn't change by 1.\n) << - "<1> expected but was\n<2>." + "Expected: 1\n Actual: 2" assert_failure(msg) do assert_mail_deliveries do 2.times { ActionMailer::Base.deliveries << '123' } end @@ -440,11 +438,11 @@ end end test 'refuse verification with custom size' do msg = %Q("ActionMailer::Base.deliveries.size" didn't change by 2.\n) << - "<2> expected but was\n<3>." + "Expected: 2\n Actual: 3" assert_failure(msg) do assert_mail_deliveries(2) do 3.times { ActionMailer::Base.deliveries << '123' } end @@ -482,14 +480,7 @@ end end def random_string(length=20) Array.new(length) { rand(36).to_s(36) }.join - end - - def table_rows - [ - ['Cuba Pete', 'King of the Ramba beat'], - ['Lou Bega', 'Mambo No. 5'] - ] end end