Browse Source

Use build rather than create where possible for faster tests

pull/22/head
baarkerlounger 3 years ago
parent
commit
23daeb8f42
  1. 2
      spec/factories/case_log.rb
  2. 4
      spec/views/case_log_index_view_spec.rb

2
spec/factories/case_log.rb

@ -11,5 +11,7 @@ FactoryBot.define do
tenant_code { "BZ737" } tenant_code { "BZ737" }
postcode { "NW1 7TY" } postcode { "NW1 7TY" }
end end
created_at { Time.now }
updated_at { Time.now }
end end
end end

4
spec/views/case_log_index_view_spec.rb

@ -1,7 +1,7 @@
require "rails_helper" require "rails_helper"
RSpec.describe "case_logs/index" do RSpec.describe "case_logs/index" do
let(:in_progress_log) { FactoryBot.create(:case_log, :in_progress) } let(:in_progress_log) { FactoryBot.build(:case_log, :in_progress) }
let(:submitted_log) { FactoryBot.create(:case_log, :submitted) } let(:submitted_log) { FactoryBot.build(:case_log, :submitted) }
context 'given an in progress log list' do context 'given an in progress log list' do
it 'renders a table for in progress logs only' do it 'renders a table for in progress logs only' do

Loading…
Cancel
Save