Skip to content

Commit 754ba28

Browse files
committed
Use host trait for community and platform model specs instead of assigning the attribute
1 parent 6c0f886 commit 754ba28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/models/better_together/community_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module BetterTogether
66
RSpec.describe Community, type: :model do # rubocop:todo Metrics/BlockLength
77
subject(:community) { build(:better_together_community) }
8-
let!(:existing_host_community) { create(:better_together_community, host: true) }
8+
let!(:existing_host_community) { create(:better_together_community, :host) }
99

1010
describe 'Factory' do
1111
it 'has a valid factory' do

spec/models/better_together/platform_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module BetterTogether
5353
end
5454

5555
context 'when a host platform already exists' do
56-
before { create(:better_together_platform, host: true) }
56+
before { create(:better_together_platform, :host) }
5757

5858
it 'does not set the host attribute to true' do
5959
platform.set_as_host
@@ -66,7 +66,7 @@ module BetterTogether
6666
describe 'Callbacks' do
6767
describe '#single_host_record' do
6868
context 'when trying to set host while another host exists' do
69-
before { create(:better_together_platform, host: true) }
69+
before { create(:better_together_platform, :host) }
7070

7171
it 'adds an error to the platform' do
7272
platform.host = true

0 commit comments

Comments
 (0)