Registration spec checks enterprise created and updated

This commit is contained in:
Rob H
2014-09-12 16:42:10 +10:00
parent 25a889375c
commit cb7033eea0

View File

@@ -16,16 +16,8 @@ feature "Registration", js: true do
# Logging in
click_link "Log in"
#page.should have_button 'Log in'
fill_in "Email", with: user.email
fill_in "Password", with: user.password
# unless page.has_button? 'Log in'
# save_screenshot('/home/rohan/ss.png', full: true)
# binding.pry
# end
click_button 'Log in'
# Log in was successful, introduction shown
@@ -59,11 +51,11 @@ feature "Registration", js: true do
# Enterprise should be created
expect(page).to have_content 'Nice one!'
# e = Enterprise.find_by_name('My Awesome Enterprise')
# expect(e.address.address1).to eq "123 Abc Street"
# expect(e.is_distributor).to eq true
# expect(e.is_primary_producer).to eq true
# expect(e.contact).to eq "Saskia Munroe"
e = Enterprise.find_by_name('My Awesome Enterprise')
expect(e.address.address1).to eq "123 Abc Street"
expect(e.is_distributor).to eq true
expect(e.is_primary_producer).to eq true
expect(e.contact).to eq "Saskia Munroe"
# Filling in about
fill_in 'enterprise_description', with: 'Short description'
@@ -74,11 +66,11 @@ feature "Registration", js: true do
# Enterprise should be updated
expect(page).to have_content 'Last step!'
# e.reload
# expect(e.description).to eq "Short description"
# expect(e.long_description).to eq "Long description"
# expect(e.abn).to eq '12345'
# expect(e.acn).to eq '54321'
e.reload
expect(e.description).to eq "Short description"
expect(e.long_description).to eq "Long description"
expect(e.abn).to eq '12345'
expect(e.acn).to eq '54321'
# Filling in social
fill_in 'enterprise_website', with: 'www.shop.com'
@@ -90,12 +82,12 @@ feature "Registration", js: true do
# Done
expect(page).to have_content "You have successfully completed the profile for My Awesome Enterprise"
# e.reload
# expect(e.website).to eq "www.shop.com"
# expect(e.facebook).to eq "FaCeBoOk"
# expect(e.linkedin).to eq "LiNkEdIn"
# expect(e.twitter).to eq "@TwItTeR"
# expect(e.instagram).to eq "@InStAgRaM"
e.reload
expect(e.website).to eq "www.shop.com"
expect(e.facebook).to eq "FaCeBoOk"
expect(e.linkedin).to eq "LiNkEdIn"
expect(e.twitter).to eq "@TwItTeR"
expect(e.instagram).to eq "@InStAgRaM"
end
it "Allows a logged in user to register a store" do