diff --git a/spec/features/edit_page_spec.rb b/spec/features/edit_page_spec.rb index 8c86539297..cc97879c13 100644 --- a/spec/features/edit_page_spec.rb +++ b/spec/features/edit_page_spec.rb @@ -61,13 +61,17 @@ end it "displays a success message for successful updates" do + new_name = "Hyper" + new_email = "example@example.com" customer = create(:customer) visit edit_admin_customer_path(customer) - fill_in "Name", with: "Hyper" - fill_in "Email", with: "example@example.com" + fill_in "Name", with: new_name + fill_in "Email", with: new_email click_on "Update Customer" + expect(page).to have_text(new_name) + expect(page).to have_text(new_email) expect(page).to have_flash("Customer was successfully updated.") end end