diff options
Diffstat (limited to 'spec/models/concerns/token_authenticatable_spec.rb')
-rw-r--r-- | spec/models/concerns/token_authenticatable_spec.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/spec/models/concerns/token_authenticatable_spec.rb b/spec/models/concerns/token_authenticatable_spec.rb index e8db83b7144..e53fdafe3b1 100644 --- a/spec/models/concerns/token_authenticatable_spec.rb +++ b/spec/models/concerns/token_authenticatable_spec.rb @@ -214,19 +214,15 @@ end RSpec.describe Ci::Build, 'TokenAuthenticatable' do let(:token_field) { :token } - let(:build) { FactoryBot.build(:ci_build) } + let(:build) { FactoryBot.build(:ci_build, :created) } it_behaves_like 'TokenAuthenticatable' describe 'generating new token' do context 'token is not generated yet' do describe 'token field accessor' do - it 'makes it possible to access token' do - expect(build.token).to be_nil - - build.save! - - expect(build.token).to be_present + it 'does not generate a token when saving a build' do + expect { build.save! }.not_to change(build, :token).from(nil) end end |