Commit 9cf0d7e8 by vulehuan

rspec: card - step 2: click continue with invalid infos - required field

parent c53002c1
......@@ -185,31 +185,50 @@ describe "CardPages" do
# let(:customer_info) { FactoryGirl.create(:my_card) }
describe "with invalid information" do
describe "when fullname is not present" do
# before do
# visit url_for(controller: 'cards', action: 'checkout')
# # puts page.html
# puts Product.all.count.to_s
# # fill_in_order_form()
# fill_in "full_name", with: ""
# end
# it {
# # puts html
# should have_selector('.alert.alert-error', text: 'Full name is required')
before do
visit url_for(controller: 'cards', action: 'checkout')
fill_in_order_form()
fill_in "Full name", with: ""
click_button "Continue"
end
# }
it { should have_selector('.alert.alert-error', text: 'Full name is required') }
end
describe "when email is not present" do
before do
visit url_for(controller: 'cards', action: 'checkout')
fill_in_order_form()
fill_in "Email", with: ""
click_button "Continue"
end
it { should have_selector('.alert.alert-error', text: 'Email is required') }
end
describe "when email is not valid" do
end
describe "when phone is not present" do
before do
visit url_for(controller: 'cards', action: 'checkout')
fill_in_order_form()
fill_in "Phone", with: ""
click_button "Continue"
end
it { should have_selector('.alert.alert-error', text: 'Phone is required') }
end
describe "when address is not present" do
before do
visit url_for(controller: 'cards', action: 'checkout')
fill_in_order_form()
fill_in "Address", with: ""
click_button "Continue"
end
it { should have_selector('.alert.alert-error', text: 'Address is required') }
end
end
......
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