Add a test for service template.
This commit is contained in:
parent
9f33898f7a
commit
378520bd8b
1 changed files with 25 additions and 0 deletions
|
@ -60,4 +60,29 @@ describe Service do
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue