Commit 984513d7 by vulehuan

rspec: card - step 3: when click product name

parent a28faf92
......@@ -317,7 +317,26 @@ describe "CardPages" do
it { should have_selector('.alert.alert-error', text: 'Please enter your shipping information') }
end
describe "when pass step 1 and step 2" do
before do
visit url_for(controller: 'cards', action: 'checkout')
fill_in_order_form()
click_button "Continue"
end
it { should have_title(full_title('Confirmation')) }
it { should have_selector('h2', text: 'Confirmation') }
it { should have_content('Please check your information:') }
it { should have_selector('.card-item-list') }
describe "when click product name" do
let(:product) { Product.first }
before do
page.find(:xpath, "//a[@href='#{product_url(product)}']").click
end
it { should have_title(product.name) }
it { should have_xpath("//a[@href='#{cards_path(product_id: product.id)}']") }
end
describe "when click Back" do
......@@ -329,6 +348,7 @@ describe "CardPages" do
describe "calculate price" do
end
end
end
describe "step 4" do
before { visit url_for(controller: 'cards', action: 'thankyou') }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment