Skip to content
Snippets Groups Projects
Commit ceb1ebd9 authored by Valery Sizov's avatar Valery Sizov Committed by James Edwards-Jones
Browse files

Active tense test coverage

parent 659cceb0
No related branches found
No related tags found
No related merge requests found
Showing
with 29 additions and 29 deletions
Loading
Loading
@@ -89,7 +89,7 @@ describe 'Comments', feature: true do
end
end
 
it 'should reset the edit note form textarea with the original content of the note if cancelled' do
it 'resets the edit note form textarea with the original content of the note if cancelled' do
within('.current-note-edit-form') do
fill_in 'note[note]', with: 'Some new content'
find('.btn-cancel').click
Loading
Loading
@@ -198,7 +198,7 @@ describe 'Comments', feature: true do
end
 
describe 'the note form' do
it "shouldn't add a second form for same row" do
it "does not add a second form for same row" do
click_diff_line
 
is_expected.
Loading
Loading
@@ -206,7 +206,7 @@ describe 'Comments', feature: true do
count: 1)
end
 
it 'should be removed when canceled' do
it 'is removed when canceled' do
is_expected.to have_css('.js-temp-notes-holder')
 
page.within("form[data-line-code='#{line_code}']") do
Loading
Loading
Loading
Loading
@@ -134,7 +134,7 @@ describe DiffHelper do
let(:new_pos) { 50 }
let(:text) { 'some_text' }
 
it "should generate foldable top match line for inline view with empty text by default" do
it "generates foldable top match line for inline view with empty text by default" do
output = diff_match_line old_pos, new_pos
 
expect(output).to be_html_safe
Loading
Loading
@@ -143,7 +143,7 @@ describe DiffHelper do
expect(output).to have_css 'td:nth-child(3):not(.parallel).line_content.match', text: ''
end
 
it "should allow to define text and bottom option" do
it "allows to define text and bottom option" do
output = diff_match_line old_pos, new_pos, text: text, bottom: true
 
expect(output).to be_html_safe
Loading
Loading
@@ -152,7 +152,7 @@ describe DiffHelper do
expect(output).to have_css 'td:nth-child(3):not(.parallel).line_content.match', text: text
end
 
it "should generate match line for parallel view" do
it "generates match line for parallel view" do
output = diff_match_line old_pos, new_pos, text: text, view: :parallel
 
expect(output).to be_html_safe
Loading
Loading
@@ -162,7 +162,7 @@ describe DiffHelper do
expect(output).to have_css 'td:nth-child(4).line_content.match.parallel', text: text
end
 
it "should allow to generate only left match line for parallel view" do
it "allows to generate only left match line for parallel view" do
output = diff_match_line old_pos, nil, text: text, view: :parallel
 
expect(output).to be_html_safe
Loading
Loading
@@ -171,7 +171,7 @@ describe DiffHelper do
expect(output).not_to have_css 'td:nth-child(3)'
end
 
it "should allow to generate only right match line for parallel view" do
it "allows to generate only right match line for parallel view" do
output = diff_match_line nil, new_pos, text: text, view: :parallel
 
expect(output).to be_html_safe
Loading
Loading
Loading
Loading
@@ -113,7 +113,7 @@
});
});
describe('::getAwardUrl', function() {
return it('should return the url for request', function() {
return it('returns the url for request', function() {
return expect(awardsHandler.getAwardUrl()).toBe('http://test.host/frontend-fixtures/issues-project/issues/1/toggle_award_emoji');
});
});
Loading
Loading
Loading
Loading
@@ -12,11 +12,11 @@ describe Gitlab::Diff::Highlight, lib: true do
context "with a diff file" do
let(:subject) { Gitlab::Diff::Highlight.new(diff_file, repository: project.repository).highlight }
 
it 'should return Gitlab::Diff::Line elements' do
it 'returns Gitlab::Diff::Line elements' do
expect(subject.first).to be_an_instance_of(Gitlab::Diff::Line)
end
 
it 'should not modify "match" lines' do
it 'does not modify "match" lines' do
expect(subject[0].text).to eq('@@ -6,12 +6,18 @@ module Popen')
expect(subject[22].text).to eq('@@ -19,6 +25,7 @@ module Popen')
end
Loading
Loading
@@ -43,11 +43,11 @@ describe Gitlab::Diff::Highlight, lib: true do
context "with diff lines" do
let(:subject) { Gitlab::Diff::Highlight.new(diff_file.diff_lines, repository: project.repository).highlight }
 
it 'should return Gitlab::Diff::Line elements' do
it 'returns Gitlab::Diff::Line elements' do
expect(subject.first).to be_an_instance_of(Gitlab::Diff::Line)
end
 
it 'should not modify "match" lines' do
it 'does not modify "match" lines' do
expect(subject[0].text).to eq('@@ -6,12 +6,18 @@ module Popen')
expect(subject[22].text).to eq('@@ -19,6 +25,7 @@ module Popen')
end
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe Gitlab::Diff::ParallelDiff, lib: true do
subject { described_class.new(diff_file) }
 
describe '#parallelize' do
it 'should return an array of arrays containing the parsed diff' do
it 'returns an array of arrays containing the parsed diff' do
diff_lines = diff_file.highlighted_diff_lines
expected = [
# Unchanged lines
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ describe Gitlab::Highlight, lib: true do
Gitlab::Highlight.highlight_lines(project.repository, commit.id, 'files/ruby/popen.rb')
end
 
it 'should properly highlight all the lines' do
it 'highlights all the lines properly' do
expect(lines[4]).to eq(%Q{<span id="LC5" class="line"> <span class="kp">extend</span> <span class="nb">self</span></span>\n})
expect(lines[21]).to eq(%Q{<span id="LC22" class="line"> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">directory?</span><span class="p">(</span><span class="n">path</span><span class="p">)</span></span>\n})
expect(lines[26]).to eq(%Q{<span id="LC27" class="line"> <span class="vi">@cmd_status</span> <span class="o">=</span> <span class="mi">0</span></span>\n})
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ describe Gitlab::LDAP::Access, lib: true do
 
it { is_expected.to be_falsey }
 
it 'should block user in GitLab' do
it 'blocks user in GitLab' do
expect(access).to receive(:block_user).with(user, 'does not exist anymore')
 
access.allowed?
Loading
Loading
Loading
Loading
@@ -67,7 +67,7 @@ describe API::Builds, api: true do
context 'unauthorized user' do
let(:api_user) { nil }
 
it 'should not return project builds' do
it 'does not return project builds' do
expect(response).to have_http_status(401)
end
end
Loading
Loading
Loading
Loading
@@ -326,7 +326,7 @@ describe API::Groups, api: true do
expect(response).to have_http_status(404)
end
 
it "should only return projects to which user has access" do
it "only returns projects to which user has access" do
project3.team << [user3, :developer]
 
get api("/groups/#{group1.id}/projects", user3)
Loading
Loading
@@ -338,7 +338,7 @@ describe API::Groups, api: true do
end
 
context "when authenticated as admin" do
it "should return any existing group" do
it "returns any existing group" do
get api("/groups/#{group2.id}/projects", admin)
 
expect(response).to have_http_status(200)
Loading
Loading
@@ -346,7 +346,7 @@ describe API::Groups, api: true do
expect(json_response.first['name']).to eq(project2.name)
end
 
it "should not return a non existing group" do
it "does not return a non existing group" do
get api("/groups/1328/projects", admin)
 
expect(response).to have_http_status(404)
Loading
Loading
@@ -354,7 +354,7 @@ describe API::Groups, api: true do
end
 
context 'when using group path in URL' do
it 'should return any existing group' do
it 'returns any existing group' do
get api("/groups/#{group1.path}/projects", admin)
 
expect(response).to have_http_status(200)
Loading
Loading
Loading
Loading
@@ -459,7 +459,7 @@ describe API::Projects, api: true do
before { project }
before { admin }
 
it 'should create new project without path and return 201' do
it 'creates new project without path and return 201' do
expect { post api("/projects/user/#{user.id}", admin), name: 'foo' }.to change {Project.count}.by(1)
expect(response).to have_http_status(201)
end
Loading
Loading
Loading
Loading
@@ -458,7 +458,7 @@ describe Ci::API::Builds do
before { build.run! }
 
describe "POST /builds/:id/artifacts/authorize" do
context "should authorize posting artifact to running build" do
context "authorizes posting artifact to running build" do
it "using token as parameter" do
post authorize_url, { token: build.token }, headers
 
Loading
Loading
@@ -492,7 +492,7 @@ describe Ci::API::Builds do
end
end
 
context "should fail to post too large artifact" do
context "fails to post too large artifact" do
it "using token as parameter" do
stub_application_setting(max_artifacts_size: 0)
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe EventCreateService, services: true do
 
it { expect(service.open_issue(issue, issue.author)).to be_truthy }
 
it "should create new event" do
it "creates new event" do
expect { service.open_issue(issue, issue.author) }.to change { Event.count }
end
end
Loading
Loading
@@ -19,7 +19,7 @@ describe EventCreateService, services: true do
 
it { expect(service.close_issue(issue, issue.author)).to be_truthy }
 
it "should create new event" do
it "creates new event" do
expect { service.close_issue(issue, issue.author) }.to change { Event.count }
end
end
Loading
Loading
@@ -29,7 +29,7 @@ describe EventCreateService, services: true do
 
it { expect(service.reopen_issue(issue, issue.author)).to be_truthy }
 
it "should create new event" do
it "creates new event" do
expect { service.reopen_issue(issue, issue.author) }.to change { Event.count }
end
end
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe MergeRequests::CloseService, services: true do
it { expect(@merge_request).to be_valid }
it { expect(@merge_request).to be_closed }
 
it 'should execute hooks with close action' do
it 'executes hooks with close action' do
expect(service).to have_received(:execute_hooks).
with(@merge_request, 'close')
end
Loading
Loading
Loading
Loading
@@ -20,7 +20,7 @@ describe 'gitlab:mail_google_schema_whitelisting rake task' do
Rake.application.invoke_task "gitlab:mail_google_schema_whitelisting"
end
 
it 'should run the task without errors' do
it 'runs the task without errors' do
expect { run_rake_task }.not_to raise_error
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment