From f25d25d1d9e00db43565a48af9458883879b4299 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 27 Apr 2019 10:36:07 +0100 Subject: Use create! in the tests As this should make finding out about validation errors easier. --- test/controllers/backends/terraform_aws_controller_test.rb | 6 +++--- test/controllers/backends/terraform_libvirt_controller_test.rb | 6 +++--- test/controllers/govuk_guix/revisions_controller_test.rb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/controllers') diff --git a/test/controllers/backends/terraform_aws_controller_test.rb b/test/controllers/backends/terraform_aws_controller_test.rb index f98890f..2815e83 100644 --- a/test/controllers/backends/terraform_aws_controller_test.rb +++ b/test/controllers/backends/terraform_aws_controller_test.rb @@ -38,7 +38,7 @@ class Backends::TerraformAwsControllerTest < ActionDispatch::IntegrationTest end test 'update' do - backend = Backends::TerraformAws.create( + backend = Backends::TerraformAws.create!( label: 'Old label', aws_region: 'old-test-region', aws_access_key_id: 'old-test-access-key-id', @@ -66,7 +66,7 @@ class Backends::TerraformAwsControllerTest < ActionDispatch::IntegrationTest end test 'show' do - backend = Backends::TerraformAws.create( + backend = Backends::TerraformAws.create!( label: 'Test Backend', aws_region: 'old-test-region', aws_access_key_id: 'old-test-access-key-id', @@ -81,7 +81,7 @@ class Backends::TerraformAwsControllerTest < ActionDispatch::IntegrationTest end test 'destroy' do - backend = Backends::TerraformAws.create( + backend = Backends::TerraformAws.create!( label: 'Test Backend', aws_region: 'old-test-region', aws_access_key_id: 'old-test-access-key-id', diff --git a/test/controllers/backends/terraform_libvirt_controller_test.rb b/test/controllers/backends/terraform_libvirt_controller_test.rb index b34a8ac..46ba435 100644 --- a/test/controllers/backends/terraform_libvirt_controller_test.rb +++ b/test/controllers/backends/terraform_libvirt_controller_test.rb @@ -35,7 +35,7 @@ class Backends::TerraformLibvirtControllerTest < ActionDispatch::IntegrationTest end test 'update' do - backend = Backends::TerraformLibvirt.create( + backend = Backends::TerraformLibvirt.create!( label: 'Old label', domain: 'old.domain.example.com', uri: 'old://uri' @@ -56,7 +56,7 @@ class Backends::TerraformLibvirtControllerTest < ActionDispatch::IntegrationTest end test 'show' do - backend = Backends::TerraformLibvirt.create( + backend = Backends::TerraformLibvirt.create!( label: 'Test Backend', domain: 'test.backend.example.com', uri: 'test://uri' @@ -68,7 +68,7 @@ class Backends::TerraformLibvirtControllerTest < ActionDispatch::IntegrationTest end test 'destroy' do - backend = Backends::TerraformLibvirt.create( + backend = Backends::TerraformLibvirt.create!( label: 'Test Backend', domain: 'test.backend.example.com', uri: 'test://uri' diff --git a/test/controllers/govuk_guix/revisions_controller_test.rb b/test/controllers/govuk_guix/revisions_controller_test.rb index 6f08489..a0c4d78 100644 --- a/test/controllers/govuk_guix/revisions_controller_test.rb +++ b/test/controllers/govuk_guix/revisions_controller_test.rb @@ -6,7 +6,7 @@ class GovukGuix::RevisionsControllerTest < ActionDispatch::IntegrationTest end test 'show' do - revision = GovukGuix::Revision.create( + revision = GovukGuix::Revision.create!( commit_hash: 'test-commit-hash', store_path: 'test-store-path' ) -- cgit v1.2.3