提交 12d44272 编写于 作者: G Grzegorz Bizon 提交者: James Edwards-Jones

Fix Rubocop offenses

上级 66bfc9e9
...@@ -23,13 +23,13 @@ describe PagesDomain, models: true do ...@@ -23,13 +23,13 @@ describe PagesDomain, models: true do
context 'no domain' do context 'no domain' do
let(:domain) { nil } let(:domain) { nil }
it { is_expected.to_not be_valid } it { is_expected.not_to be_valid }
end end
context 'invalid domain' do context 'invalid domain' do
let(:domain) { '0123123' } let(:domain) { '0123123' }
it { is_expected.to_not be_valid } it { is_expected.not_to be_valid }
end end
context 'domain from .example.com' do context 'domain from .example.com' do
...@@ -37,7 +37,7 @@ describe PagesDomain, models: true do ...@@ -37,7 +37,7 @@ describe PagesDomain, models: true do
before { allow(Settings.pages).to receive(:host).and_return('domain.com') } before { allow(Settings.pages).to receive(:host).and_return('domain.com') }
it { is_expected.to_not be_valid } it { is_expected.not_to be_valid }
end end
end end
...@@ -47,13 +47,13 @@ describe PagesDomain, models: true do ...@@ -47,13 +47,13 @@ describe PagesDomain, models: true do
context 'when only certificate is specified' do context 'when only certificate is specified' do
let(:domain) { build(:pages_domain, :with_certificate) } let(:domain) { build(:pages_domain, :with_certificate) }
it { is_expected.to_not be_valid } it { is_expected.not_to be_valid }
end end
context 'when only key is specified' do context 'when only key is specified' do
let(:domain) { build(:pages_domain, :with_key) } let(:domain) { build(:pages_domain, :with_key) }
it { is_expected.to_not be_valid } it { is_expected.not_to be_valid }
end end
context 'with matching key' do context 'with matching key' do
...@@ -65,7 +65,7 @@ describe PagesDomain, models: true do ...@@ -65,7 +65,7 @@ describe PagesDomain, models: true do
context 'for not matching key' do context 'for not matching key' do
let(:domain) { build(:pages_domain, :with_missing_chain, :with_key) } let(:domain) { build(:pages_domain, :with_missing_chain, :with_key) }
it { is_expected.to_not be_valid } it { is_expected.not_to be_valid }
end end
end end
...@@ -157,6 +157,6 @@ describe PagesDomain, models: true do ...@@ -157,6 +157,6 @@ describe PagesDomain, models: true do
subject { domain.certificate_text } subject { domain.certificate_text }
# We test only existence of output, since the output is long # We test only existence of output, since the output is long
it { is_expected.to_not be_empty } it { is_expected.not_to be_empty }
end end
end end
...@@ -26,7 +26,7 @@ describe PagesService, services: true do ...@@ -26,7 +26,7 @@ describe PagesService, services: true do
before { build.status = status } before { build.status = status }
it 'should not execute worker' do it 'should not execute worker' do
expect(PagesWorker).to_not receive(:perform_async) expect(PagesWorker).not_to receive(:perform_async)
service.execute service.execute
end end
end end
...@@ -40,7 +40,7 @@ describe PagesService, services: true do ...@@ -40,7 +40,7 @@ describe PagesService, services: true do
end end
it 'should not execute worker' do it 'should not execute worker' do
expect(PagesWorker).to_not receive(:perform_async) expect(PagesWorker).not_to receive(:perform_async)
service.execute service.execute
end end
end end
......
...@@ -34,7 +34,7 @@ describe Projects::UpdatePagesService do ...@@ -34,7 +34,7 @@ describe Projects::UpdatePagesService do
it 'limits pages size' do it 'limits pages size' do
stub_application_setting(max_pages_size: 1) stub_application_setting(max_pages_size: 1)
expect(execute).to_not eq(:success) expect(execute).not_to eq(:success)
end end
it 'removes pages after destroy' do it 'removes pages after destroy' do
...@@ -49,29 +49,29 @@ describe Projects::UpdatePagesService do ...@@ -49,29 +49,29 @@ describe Projects::UpdatePagesService do
it 'fails if sha on branch is not latest' do it 'fails if sha on branch is not latest' do
pipeline.update_attributes(sha: 'old_sha') pipeline.update_attributes(sha: 'old_sha')
build.update_attributes(artifacts_file: file) build.update_attributes(artifacts_file: file)
expect(execute).to_not eq(:success) expect(execute).not_to eq(:success)
end end
it 'fails for empty file fails' do it 'fails for empty file fails' do
build.update_attributes(artifacts_file: empty_file) build.update_attributes(artifacts_file: empty_file)
expect(execute).to_not eq(:success) expect(execute).not_to eq(:success)
end end
end end
end end
it 'fails to remove project pages when no pages is deployed' do it 'fails to remove project pages when no pages is deployed' do
expect(PagesWorker).to_not receive(:perform_in) expect(PagesWorker).not_to receive(:perform_in)
expect(project.pages_deployed?).to be_falsey expect(project.pages_deployed?).to be_falsey
project.destroy project.destroy
end end
it 'fails if no artifacts' do it 'fails if no artifacts' do
expect(execute).to_not eq(:success) expect(execute).not_to eq(:success)
end end
it 'fails for invalid archive' do it 'fails for invalid archive' do
build.update_attributes(artifacts_file: invalid_file) build.update_attributes(artifacts_file: invalid_file)
expect(execute).to_not eq(:success) expect(execute).not_to eq(:success)
end end
def execute def execute
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册