Browse files

Revert "Add a pair of spec helpers"

This reverts commit f1c4ec5.
  • Loading branch information...
1 parent f1c4ec5 commit 40330462d4c0bda28db35b065fb81d3da3af5850 @simonewebdesign committed Jan 1, 2013
View
6 spec/requests/authentication_pages_spec.rb
@@ -8,7 +8,7 @@
before { visit signin_path }
it { should have_selector('h1', text: 'Sign in') }
- it { should have_title('Sign in') }
+ it { should have_selector('title', text: 'Sign in') }
describe "with valid information" do
let(:user) { FactoryGirl.create(:user) }
@@ -19,7 +19,7 @@
# end
before { valid_signin(user) }
- it { should have_title(user.name) }
+ it { should have_selector('title', text: user.name) }
it { should have_link('Profile', href: user_path(user)) }
it { should have_link('Sign out', href: signout_path) }
it { should_not have_link('Sign in', href: signin_path) }
@@ -28,7 +28,7 @@
describe "with invalid information" do
before { click_button "Sign in" }
- it { should have_title('Sign in') }
+ it { should have_selector('title', text: 'Sign in') }
it { should have_error_message('Invalid') }
describe "after visiting another page" do
View
2 spec/requests/static_pages_spec.rb
@@ -6,7 +6,7 @@
shared_examples_for "all static pages" do
it { should have_selector('h1', text: heading) }
- it { should have_title(full_title(page_title)) }
+ it { should have_selector('title', text: full_title(page_title)) }
end
describe "Home page" do
View
11 spec/requests/user_pages_spec.rb
@@ -8,7 +8,7 @@
before { visit signup_path }
it { should have_selector('h1', text: 'Sign up') }
- it { should have_title('Sign up') }
+ it { should have_selector('title', text: 'Sign up') }
end
@@ -20,7 +20,7 @@
it { should have_selector('h1', text: user.name) }
end
define "username should be in title" do
- it { should have_title(user.name) }
+ it { should have_selector('title', text: user.name) }
end
end
@@ -39,7 +39,7 @@
describe "after submission" do
before { click_button submit }
- it { should have_title('Sign up') }
+ it { should have_selector('title', text: 'Sign up') }
it { should have_content('error') }
end
@@ -61,11 +61,10 @@
before { click_button submit }
let(:user) { User.find_by_email('user@example.com') }
- it { should have_title(user.name) }
- it { should have_success_message('Welcome') }
+ it { should have_selector('title', text: user.name) }
+ it { should have_selector('div.alert.alert-success', text: 'Welcome') }
it { should have_link('Sign out') }
-
describe "followed by signout" do
before { click_link "Sign out" }
it { should have_link('Sign in') }
View
12 spec/support/utilities.rb
@@ -23,15 +23,3 @@ def valid_signin(user)
page.should have_selector('div.alert.alert-error', text: message)
end
end
-
-RSpec::Matchers.define :have_success_message do |message|
- match do |page|
- page.should have_selector('div.alert.alert-success', text: message)
- end
-end
-
-RSpec::Matchers.define :have_title do |title|
- match do |page|
- page.should have_title(title)
- end
-end

0 comments on commit 4033046

Please sign in to comment.