Registration process sets sells to 'unspecified'

This commit is contained in:
Rob Harrington
2014-10-23 15:47:46 +11:00
parent 4f2327f05c
commit d94ca0174a
2 changed files with 6 additions and 1 deletions

View File

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

View File

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