remove denormalization of lists and orders towards the section
This commit is contained in:
@@ -56,14 +56,6 @@ describe List do
|
||||
it "changes the table" do
|
||||
expect{ list.move_to_table! new_table }.to change{ list.table_id }.to( new_table.id )
|
||||
end
|
||||
|
||||
it "changes the section" do
|
||||
expect{ list.move_to_table! new_table }.to change{ list.section_id }.to( new_section.id )
|
||||
end
|
||||
|
||||
it "changes the section of the orders" do
|
||||
expect{ list.move_to_table! new_table }.to change{ @order1.reload; @order1.section_id }.to( new_section.id )
|
||||
end
|
||||
end
|
||||
|
||||
describe '#has_active_orders?' do
|
||||
|
||||
@@ -4,15 +4,13 @@ describe "User lists", type: :request do
|
||||
let(:supplier){ create :supplier }
|
||||
let(:user){ create :user}
|
||||
before do
|
||||
supplier.add_employee(employee)
|
||||
login_as employee, scope: :employee
|
||||
#supplier.add_employee(employee)
|
||||
#login_as employee, scope: :employee
|
||||
end
|
||||
it "works" do
|
||||
supplier = create :supplier
|
||||
get "/supplier/suppliers/#{supplier.id}.json"
|
||||
api_response.data.relationships.product_categorie
|
||||
included_section = api_response.included.find{|ih| ih['type'] == 'sections'}
|
||||
included_section['relationships']['tables']['data'].should eq []
|
||||
included_section['relationships']['section-areas']['data'].should eq []
|
||||
get current_users_lists_path, auth_token: user.authentication_token
|
||||
expect( api_response ).to eq Hash.new
|
||||
response.status.should eq 404
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user