From 5bf571f1ede4f14142051c9b8ae32314c5ff46c1 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 20 Sep 2010 14:10:27 -0300 Subject: [PATCH] Fix tests --- features/contact.feature | 4 ++-- test/functional/contact_controller_test.rb | 2 +- test/functional/profile_controller_test.rb | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/contact.feature b/features/contact.feature index 23e1be6..b680d6c 100644 --- a/features/contact.feature +++ b/features/contact.feature @@ -14,7 +14,7 @@ In order to ask questions and solve problems Scenario: without states Given I am on Sample Community's homepage - When I follow "Send a message" + When I follow "Send an e-mail" Then I should not see "City and state" Scenario: with states @@ -22,6 +22,6 @@ In order to ask questions and solve problems | name | | Bahia | And I am on Sample Community's homepage - When I follow "Send a message" + When I follow "Send an e-mail" Then I should see "City and state" diff --git a/test/functional/contact_controller_test.rb b/test/functional/contact_controller_test.rb index f3c2811..9ae51b2 100644 --- a/test/functional/contact_controller_test.rb +++ b/test/functional/contact_controller_test.rb @@ -27,7 +27,7 @@ class ContactControllerTest < Test::Unit::TestCase should 'display destinatary name in title' do get :new, :profile => enterprise.identifier - assert_tag :tag => 'h1', :content => "Send a message to #{enterprise.name}" + assert_tag :tag => 'h1', :content => /Send.*#{enterprise.name}/ end should 'add form to create contact via post' do diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index 51024e4..fafd80b 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -337,19 +337,19 @@ class ProfileControllerTest < Test::Unit::TestCase should 'display contact us for enterprises' do ent = Enterprise.create!(:name => 'my test enterprise', :identifier => 'my-test-enterprise') get :index, :profile => 'my-test-enterprise' - assert_tag :tag => 'a', :attributes => { :href => "/contact/my-test-enterprise/new" }, :content => 'Send a message' + assert_tag :tag => 'a', :attributes => { :href => "/contact/my-test-enterprise/new" }, :content => /Send/ end should 'not display contact us for non-enterprises' do get :index, :profile => @profile.identifier - assert_no_tag :tag => 'a', :attributes => { :href => "/contact/#{@profile.identifier}/new" }, :content => 'Send a message' + assert_no_tag :tag => 'a', :attributes => { :href => "/contact/#{@profile.identifier}/new" }, :content => /Send/ end should 'display contact us only if enabled' do ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise') ent.update_attribute(:enable_contact_us, false) get :index, :profile => 'my-test-enterprise' - assert_no_tag :tag => 'a', :attributes => { :href => "/contact/my-test-enterprise/new" }, :content => 'Send a message' + assert_no_tag :tag => 'a', :attributes => { :href => "/contact/my-test-enterprise/new" }, :content => /Send/ end should 'display contact button only if friends' do -- libgit2 0.21.2