How is it possible to use before and after hooks in feature specs just for
one of scenarios only ?
I tried to use one as follows:
feature "Operations page" do
... some scenarios are omitted...
scenario "List all operations with pagination" do
before(:all) do
31.times do
create(:deposit,
value_date: Date.today,
sum: 1000,
rate: 2.5,
withholding: 12,
close_date: Date.today + 3.months)
end
end
expect(page).to have_selector('div.pagination')
end
and getting the error:
Failure/Error: before(:all) do
NoMethodError:
undefined method `before' for
#<RSpec::Core::ExampleGroup::Nested_1:0x5a3b328>
It's OK to use 'background' but it will be executed before each of the
feature scenarios if I'm not mistaken. Right ?
I'm using RSpec 2.14.2
Ruby 2.0.0p353
Rails 4.0.3
Thank you.
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/d7869d64-09f7-4e19-855d-cc8b94caedc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.