Remove unrequired store registration action

This commit is contained in:
Rob Harrington
2014-10-17 10:49:54 +11:00
parent c4d47ccc20
commit 81715aaf5d
4 changed files with 1 additions and 46 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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