I have a test defined as follows:
it "should have allow you to fill out the new form and save a customer" do customer = Factory.build(:customer) visit new_customer_path factory_to_form "customer", customer, ["kf_code", "supported"] click_button "customer_submit" current_path.should eq(customer_path(Customer.last)) page.should have_content "created customer" page.should have_content customer.long_name end
its pretty simple that it installs a client for my factory client, and then fills out a new action form with data from that factory (which my factory_to_form macro does) and clicks the submit button.
My problem is that the submit button never affects the create action, its transition to "/ customers" and not saving the client.
The form is the standard form_for(@customer) , and the button is just f.submit , I canβt figure out why this form will work fine in the browser, but not in this test.
Why won't the capybara fit in the right place?
source share