When running the first x3 scenarios my Rspec assertions don't seem to be working. I can't work out why! Please could somebody assist. I would be eternally grateful!
The errors are as follows:
1.
my steps for this is..
Then I should see "Thank you for adopting a puppy!"
Then(/^I should see "([^"]*)"$/) do |expected|
expect.(@broswer.text).to include expected
end
get these errors
ArgumentError: You must pass either an argument or a block to `expect`.
./features/step_definitions/adopting_puppy_steps.rb:40:in `/^I should see "([^"]*)"$/'
./features/adopting_puppies.feature:18:in `Then I should see "Thank you for adopting a puppy!"'
ArgumentError: You must pass either an argument or a block to `expect`.
./features/step_definitions/adopting_puppy_steps.rb:40:in `/^I should see "([^"]*)"$/'
./features/adopting_puppies.feature:32:in `Then I should see "Thank you for adopting a puppy!"'
2.my steps are
And I should see "$34.95" as the subtotal for line item 1
And I should see "$34.95" as the cart total
And(/^I should see "\$34\.95" as the subtotal for line item (\d+)$/) do |subtotal, line_item|
row = (line_item.to_i - 1) * 6
expect(@browser.table(:index => 0)[row][3].text).to eql subtotal
end
error
Cucumber::ArityMismatchError: Your block takes 2 arguments, but the Regexp matched 1 argument.
features/step_definitions/adopting_puppy_steps.rb:59:in `/^I should see "\$34\.95" as the subtotal for line item (\d+)$/'
./features/adopting_puppies.feature:39:in `And I should see "$34.95" as the subtotal for line item 1'