mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Registration process sets sells to 'unspecified'
This commit is contained in:
@@ -3,6 +3,7 @@ module Api
|
||||
|
||||
before_filter :override_owner, only: [:create, :update]
|
||||
before_filter :check_type, only: :update
|
||||
before_filter :override_sells, only: [:create, :update]
|
||||
respond_to :json
|
||||
|
||||
def managed
|
||||
@@ -59,5 +60,9 @@ module Api
|
||||
def check_type
|
||||
params[:enterprise].delete :type unless current_api_user.admin?
|
||||
end
|
||||
|
||||
def override_sells
|
||||
params[:enterprise][:sells] = 'unspecified'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,7 +51,7 @@ feature "Registration", js: true do
|
||||
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.sells).to eq "none"
|
||||
expect(e.sells).to eq "unspecified"
|
||||
expect(e.is_primary_producer).to eq true
|
||||
expect(e.contact).to eq "Saskia Munroe"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user