Changes assertion from URL to page content on spec file

This commit is contained in:
filipefurtad0
2022-01-18 15:10:31 +00:00
parent 3b6bb1c9a8
commit 63ae159091

View File

@@ -58,7 +58,6 @@ describe "As a consumer, I want to checkout my order", js: true do
it "should display the split checkout login page" do
expect(page).to have_content distributor.name
expect(page).to have_current_path("/checkout/guest")
expect(page).to have_content("Ok, ready to checkout?")
expect(page).to have_content("Login")
expect(page).to have_no_content("Checkout as guest")
@@ -68,12 +67,13 @@ describe "As a consumer, I want to checkout my order", js: true do
order.update(state: "payment")
get checkout_step_path(:details)
expect(response).to have_http_status(:redirect)
expect(page).to have_current_path("/checkout/guest")
expect(page).to have_content("Ok, ready to checkout?")
end
it "should redirect to the login page when clicking the login button" do
click_on "Login"
expect(page).to have_current_path "/"
expect(page).to have_content("Login")
expect(page).to have_content("Login")
end
end
@@ -86,7 +86,6 @@ describe "As a consumer, I want to checkout my order", js: true do
it "should display the split checkout login/guest page" do
expect(page).to have_content distributor.name
expect(page).to have_current_path("/checkout/guest")
expect(page).to have_content("Ok, ready to checkout?")
expect(page).to have_content("Login")
expect(page).to have_content("Checkout as guest")
@@ -95,7 +94,6 @@ describe "As a consumer, I want to checkout my order", js: true do
it "should display the split checkout details page" do
click_on "Checkout as guest"
expect(page).to have_content distributor.name
expect(page).to have_current_path("/checkout/details")
expect(page).to have_content("1 - Your details")
expect(page).to have_selector("div.checkout-tab.selected", text: "1 - Your details")
expect(page).to have_content("2 - Payment method")
@@ -122,14 +120,14 @@ describe "As a consumer, I want to checkout my order", js: true do
choose free_shipping.name
click_button "Next - Payment method"
expect(page).to have_current_path("/checkout/payment")
expect(page).to have_button("Next - Order summary")
end
context "when order is state: 'payment'" do
it "should allow visit '/checkout/details'" do
order.update(state: "payment")
visit checkout_step_path(:details)
expect(page).to have_current_path("/checkout/details")
expect(page).to have_button("Next - Payment method")
end
end
end