mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Change enterprise attributes defined in reg controller
This commit is contained in:
@@ -7,11 +7,11 @@ class RegistrationController < BaseController
|
||||
layout 'registration'
|
||||
|
||||
def index
|
||||
@enterprise_attributes = { type: 'profile' }
|
||||
@enterprise_attributes = { sells: 'none' }
|
||||
end
|
||||
|
||||
def store
|
||||
@enterprise_attributes = { is_distributor: true, is_primary_producer: true, type: 'single' }
|
||||
@enterprise_attributes = { is_primary_producer: true, sells: 'own' }
|
||||
render :index
|
||||
end
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ require 'spec_helper'
|
||||
feature "Registration", js: true do
|
||||
include WebHelper
|
||||
|
||||
# TODO fix this after removal of is_distributor.
|
||||
pending "Registering a Profile" do
|
||||
describe "Registering a Profile" do
|
||||
let(:user) { create(:user, password: "password", password_confirmation: "password") }
|
||||
|
||||
it "Allows a logged in user to register a profile" do
|
||||
@@ -18,7 +17,7 @@ feature "Registration", js: true do
|
||||
# Enter Login details
|
||||
fill_in "Email", with: user.email
|
||||
fill_in "Password", with: user.password
|
||||
click_login_and_ensure_content "This wizard will step you through creating a profile"
|
||||
click_login_and_ensure_content "Hi there!"
|
||||
|
||||
expect(URI.parse(current_url).path).to eq registration_path
|
||||
|
||||
@@ -45,8 +44,11 @@ feature "Registration", js: true do
|
||||
|
||||
# Choosing a type
|
||||
expect(page).to have_content 'Last step to create your enterprise!'
|
||||
click_link 'both-panel'
|
||||
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!'
|
||||
@@ -107,7 +109,7 @@ feature "Registration", js: true do
|
||||
# Enter Login details
|
||||
fill_in "Email", with: user.email
|
||||
fill_in "Password", with: user.password
|
||||
click_login_and_ensure_content "This wizard will step you through creating a profile"
|
||||
click_login_and_ensure_content "Hi there!"
|
||||
|
||||
expect(URI.parse(current_url).path).to eq store_registration_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user