Hello everyone,
I'm just working my way through the RSpec/Cucumber book, I love the tool but
not so much the learning curve :(
Starting with my first view, is it okay for me, in the BDD world, to do the
following or can I put them all in one 'it' block to save on having to
render the page every time. Or must they be in separate blocks with separate
renders? Or is there a fourth more elegant solution?
%w{ name address_1 address_2 address_3 postcode town_city state country
email phone www }.each do |field|
it "renders form field #{field} to create a new competition" do
@competition.stub!(field.intern).and_return ''
render "competitions/new.html.erb"
response.should have_selector("input[type=text]", :name =>
"competition[#{field}]", :value => '')
end
end
Is it okay to post this type of question if nothing jumps out at me after
googling?
Thanks
ants
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users