Don't set global before filters

This commit is contained in:
Jonas Nicklas 2010-02-20 22:04:06 +01:00
parent 38c1cbb71a
commit 65232a0dbc
2 changed files with 12 additions and 8 deletions

View File

@ -1,9 +1,7 @@
shared_examples_for "has_field" do
before do
@session.visit('/form')
end
describe '#has_field' do
before { @session.visit('/form') }
it "should be true if the field is on the page" do
@session.should have_field('Dog')
@session.should have_field('form_description')
@ -31,6 +29,8 @@ shared_examples_for "has_field" do
end
describe '#has_no_field' do
before { @session.visit('/form') }
it "should be false if the field is on the page" do
@session.should_not have_no_field('Dog')
@session.should_not have_no_field('form_description')
@ -58,6 +58,8 @@ shared_examples_for "has_field" do
end
describe '#has_checked_field?' do
before { @session.visit('/form') }
it "should be true if a checked field is on the page" do
@session.should have_checked_field('gender_female')
@session.should have_checked_field('Hamster')
@ -74,6 +76,8 @@ shared_examples_for "has_field" do
end
describe '#has_unchecked_field?' do
before { @session.visit('/form') }
it "should be false if a checked field is on the page" do
@session.should_not have_unchecked_field('gender_female')
@session.should_not have_unchecked_field('Hamster')

View File

@ -1,9 +1,7 @@
shared_examples_for "has_select" do
before do
@session.visit('/form')
end
describe '#has_select?' do
before { @session.visit('/form') }
it "should be true if the field is on the page" do
@session.should have_select('Locale')
@session.should have_select('form_region')
@ -45,6 +43,8 @@ shared_examples_for "has_select" do
end
describe '#has_no_select?' do
before { @session.visit('/form') }
it "should be false if the field is on the page" do
@session.should_not have_no_select('Locale')
@session.should_not have_no_select('form_region')