Skip to content

Commit

Permalink
Substitute let! with let
Browse files Browse the repository at this point in the history
There is no need to force the method’s invocation before each example.
  • Loading branch information
eduardoj committed Oct 30, 2023
1 parent bdb65ff commit 39fed1a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api/spec/controllers/trigger_controller_spec.rb
Expand Up @@ -17,7 +17,7 @@

describe '#rebuild' do
context 'authentication token is invalid' do
let!(:token) { nil }
let(:token) { nil }

before do
post :create, params: { format: :xml }
Expand All @@ -28,7 +28,7 @@
end

context 'when token is valid' do
let!(:token) { Token::Rebuild.create(executor: user, package: package) }
let(:token) { Token::Rebuild.create(executor: user, package: package) }

before do
allow(Backend::Api::Sources::Package).to receive(:rebuild).and_return("<status code=\"ok\" />\n")
Expand All @@ -41,7 +41,7 @@

context 'when the token is not bound to a package' do
context 'without a package passed in the parameters' do
let!(:token) { Token::Rebuild.create(executor: user) }
let(:token) { Token::Rebuild.create(executor: user) }
let(:expected_response_body) do
<<~XML
<status code="bad_request">
Expand Down Expand Up @@ -141,7 +141,7 @@

context 'when the token is not bound to a package' do
context 'without a package passed in the parameters' do
let!(:token) { Token::Release.create(executor: user) }
let(:token) { Token::Release.create(executor: user) }
let(:expected_response_body) do
<<~XML
<status code="bad_request">
Expand Down Expand Up @@ -172,7 +172,7 @@

context 'when the token is not bound to a package' do
context 'without a package passed in the parameters' do
let!(:token) { Token::Service.create(executor: user) }
let(:token) { Token::Service.create(executor: user) }
let(:expected_response_body) do
<<~XML
<status code="bad_request">
Expand Down

0 comments on commit 39fed1a

Please sign in to comment.