From 81715aaf5d06b49686cabef91f35f379d298f14e Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 17 Oct 2014 10:49:54 +1100 Subject: [PATCH] Remove unrequired store registration action --- app/controllers/registration_controller.rb | 7 +---- config/routes.rb | 1 - .../registration_controller_spec.rb | 12 --------- spec/features/consumer/registration_spec.rb | 27 ------------------- 4 files changed, 1 insertion(+), 46 deletions(-) diff --git a/app/controllers/registration_controller.rb b/app/controllers/registration_controller.rb index a7401abf60..5a21d28a44 100644 --- a/app/controllers/registration_controller.rb +++ b/app/controllers/registration_controller.rb @@ -2,7 +2,7 @@ require 'open_food_network/spree_api_key_loader' class RegistrationController < BaseController include OpenFoodNetwork::SpreeApiKeyLoader - before_filter :load_spree_api_key, only: [:index, :store] + before_filter :load_spree_api_key, only: [:index] before_filter :check_user, except: :authenticate layout 'registration' @@ -10,11 +10,6 @@ class RegistrationController < BaseController @enterprise_attributes = { sells: 'none' } end - def store - @enterprise_attributes = { is_primary_producer: true, sells: 'own' } - render :index - end - private def check_user diff --git a/config/routes.rb b/config/routes.rb index 9cdac4142d..ca4a6b59ff 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,6 @@ Openfoodnetwork::Application.routes.draw do get "/map", to: "map#index", as: :map get "/register", to: "registration#index", as: :registration - get "/register/store", to: "registration#store", as: :store_registration get "/register/auth", to: "registration#authenticate", as: :registration_auth resource :shop, controller: "shop" do diff --git a/spec/controllers/registration_controller_spec.rb b/spec/controllers/registration_controller_spec.rb index e51a28f73a..8ef292dc68 100644 --- a/spec/controllers/registration_controller_spec.rb +++ b/spec/controllers/registration_controller_spec.rb @@ -7,11 +7,6 @@ describe RegistrationController do get :index response.should redirect_to registration_auth_path(anchor: "signup?after_login=/register") end - - it "store" do - get :store - response.should redirect_to registration_auth_path(anchor: "signup?after_login=/register/store") - end end describe "redirecting when user has reached enterprise ownership limit" do @@ -41,12 +36,5 @@ describe RegistrationController do expect(assigns(:spree_api_key)).to eq user.spree_api_key end end - - describe "store" do - it "loads the spree api key" do - get :store - expect(assigns(:spree_api_key)).to eq user.spree_api_key - end - end end end diff --git a/spec/features/consumer/registration_spec.rb b/spec/features/consumer/registration_spec.rb index 8c55ae3a68..551490363c 100644 --- a/spec/features/consumer/registration_spec.rb +++ b/spec/features/consumer/registration_spec.rb @@ -46,9 +46,6 @@ feature "Registration", js: true do expect(page).to have_content 'Last step to create your enterprise!' click_link 'producer-panel' click_button 'Continue' - sleep 2 - click_button 'Continue' - save_screenshot '/Users/rob/Desktop/ss.png' # Enterprise should be created expect(page).to have_content 'Nice one!' @@ -97,30 +94,6 @@ feature "Registration", js: true do expect(e.twitter).to eq "@TwItTeR" expect(e.instagram).to eq "@InStAgRaM" end - - it "Allows a logged in user to register a store" do - visit store_registration_path - - expect(URI.parse(current_url).path).to eq registration_auth_path - - page.has_selector? "dd", text: "Log in" - switch_to_login_tab - - # Enter Login details - fill_in "Email", with: user.email - fill_in "Password", with: user.password - click_login_and_ensure_content "Hi there!" - - expect(URI.parse(current_url).path).to eq store_registration_path - - # Done reading introduction - click_button_and_ensure_content "Let's get started!", "Woot! First we need to know a little bit about your farm:" - - # Details Page - expect(page).to_not have_selector '#enterprise-types' - - # Everything from here should be covered in 'profile' spec - end end def switch_to_login_tab