Making my way through the book, I get to the 'Moving our default data' section and got an error. After banging on it for a while, I decided I got something wrong somewhere that I was not able to find, so I started over completely. Then it happened again.
I created the config/data folder, the new default.yml file with the listed values. I ran the "Adopting a puppy using all default data" scenario and am met with an error:
NoMethodError: undefined method `merge' for nil:NilClass
./features/support/pages/checkout_page.rb:19:in `checkout'
./features/step_definitions/adopting_puppies_steps.rb:50:in `/^I complete the adoption$/'
C:\Ruby\workspace\test_puppies\features\adopting_puppies.feature:89:in `And I complete the adoption'
checkout_page.rb lines 18-21:
def checkout(data ={})
populate_page_with data_for(:checkout_page, data)
place_order
end
adopting_puppies_steps.rb 49-51:
When(/^I complete the adoption$/) do
on(CheckoutPage).checkout
end
Scenario: Adopting a puppy using all default data
When I click the View Details button for "Brook"
And I click the Adopt Me button
And I click the Complete the Adoption button
And I complete the adoption
Then I should see "Thank you for adopting a puppy!"
default.yml contents:
checkout_page:
name: Cheezy
address: 123 Main Street
pay_type: Check
More info available on request