Commit 378520bd authored by Marin Jankovski's avatar Marin Jankovski

Add a test for service template.

parent 9f33898f
...@@ -60,4 +60,29 @@ describe Service do ...@@ -60,4 +60,29 @@ describe Service do
end end
end end
end end
describe "Template" do
describe "for pushover service" do
let(:service_template) {
PushoverService.create(template: true, properties: {device: 'MyDevice', sound: 'mic', priority: 4, api_key: '123456789'})
}
let(:project) { create(:project) }
describe 'should be prefilled for projects pushover service' do
before do
service_template
project.build_missing_services
end
it "should have all fields prefilled" do
service = project.pushover_service
expect(service.template).to eq(false)
expect(service.device).to eq('MyDevice')
expect(service.sound).to eq('mic')
expect(service.priority).to eq(4)
expect(service.api_key).to eq('123456789')
end
end
end
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