end of train commit
This commit is contained in:
@@ -2,7 +2,6 @@ step 'there is a confirmed and open supplier' do
|
||||
@supplier_password = 'secret1'
|
||||
@employee_password = @supplier_password
|
||||
@employee = create :employee, email: 'supplier@mozo.bar', password: @supplier_password
|
||||
binding.pry
|
||||
@supplier = build :supplier, open: true
|
||||
@supplier.add_manager @employee
|
||||
@section = create :section, title: 'Room', supplier: @supplier, width: 8, height: 8
|
||||
|
||||
@@ -128,7 +128,6 @@ describe Suppliers::ListsController, type: :controller do
|
||||
context "invalid attributes", broken: true do
|
||||
it "returns an error response" do
|
||||
put :update, id: @list, format: :json, list: invalid_params
|
||||
binding.pry
|
||||
expect( JSON.parse( response.body )['errors']).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,4 +13,14 @@ describe Employee do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#object_attributes' do
|
||||
let(:supplier){ create :supplier, employee_ids: [employee.id], employee_settings_storage: {employee.id => {manager: true}}}
|
||||
let(:employee){ create :employee }
|
||||
subject { employee.enrich_with_settings(supplier.settings_for(employee)).object_attributes }
|
||||
its(:keys){ should include 'id'}
|
||||
its(:keys){ should_not include '_id'}
|
||||
its(['id']){ should eq employee.id }
|
||||
its(['manager']){ should be true }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user