From cb7033eea08f1af762e09f5b3113edf4b6da5eeb Mon Sep 17 00:00:00 2001 From: Rob H Date: Fri, 12 Sep 2014 16:42:10 +1000 Subject: [PATCH] Registration spec checks enterprise created and updated --- spec/features/consumer/registration_spec.rb | 40 +++++++++------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/spec/features/consumer/registration_spec.rb b/spec/features/consumer/registration_spec.rb index bd12e34d80..9723422f8c 100644 --- a/spec/features/consumer/registration_spec.rb +++ b/spec/features/consumer/registration_spec.rb @@ -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