Commit 89a48ed5 authored by gwendal's avatar gwendal
Browse files

fix spec

parent 06bdc830
......@@ -321,6 +321,11 @@ RSpec.describe ServiceSaleTemplatesController, type: :controller do
service_sale_template.reload
expect(response).to redirect_to(service_sale_template.service)
end
it "redirects to the service of the service_sale_template" do
service_sale_template = FactoryBot.create :service_sale_template, service: member_radio_service
expect { put :update, {:id => service_sale_template.to_param, :service_sale_template => valid_attributes} }.to change{ TreasurerMailer.deliveries.size }.by 1
end
end
end
......
......@@ -69,9 +69,9 @@ Rspec.describe ServiceSale, type: :model do
service_id: 'rad1',
service_type: 'RadioService',
quantity: 2.0,
tax_amount: 1.0,
tax_amount: Settings.ledger_item.taxes ? 1.0 : 0.0,
net_amount: 5.0,
tax_rate: 0.2
tax_rate: Settings.ledger_item.taxes ? 0.2 : nil
}
expect(export).to eq expected
end
......
......@@ -41,11 +41,11 @@ RSpec.describe ServiceSaleTemplate, type: :model do
end
end
describe "when updating an attribute" do
it 'should send an email to the treasurer and member' do
sst = FactoryBot.create(:service_sale_template)
expect { sst.update(chargeable: false) }.to change{ TreasurerMailer.deliveries.size }.by 1
end
end
# describe "when updating an attribute" do
# it 'should send an email to the treasurer and member' do
# sst = FactoryBot.create(:service_sale_template)
# expect { sst.update(chargeable: false) }.to change{ TreasurerMailer.deliveries.size }.by 1
# end
# end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment