Commit 519275c1 authored by tiagonbotelho's avatar tiagonbotelho
Browse files

fixes part1 of files to start using active tense

parent 551ffc0a
......@@ -39,7 +39,7 @@
user.ldap_block
end
it 'will not unblock user' do
it 'does not unblock user' do
put :unblock, id: user.username
user.reload
expect(user.blocked?).to be_truthy
......
......@@ -5,7 +5,7 @@
let(:user) { create(:user) }
let(:controller) { ApplicationController.new }
it 'should redirect if the user is over their password expiry' do
it 'redirects if the user is over their password expiry' do
user.password_expires_at = Time.new(2002)
expect(user.ldap_user?).to be_falsey
allow(controller).to receive(:current_user).and_return(user)
......@@ -14,7 +14,7 @@
controller.send(:check_password_expiration)
end
it 'should not redirect if the user is under their password expiry' do
it 'does not redirect if the user is under their password expiry' do
user.password_expires_at = Time.now + 20010101
expect(user.ldap_user?).to be_falsey
allow(controller).to receive(:current_user).and_return(user)
......@@ -22,7 +22,7 @@
controller.send(:check_password_expiration)
end
it 'should not redirect if the user is over their password expiry but they are an ldap user' do
it 'does not redirect if the user is over their password expiry but they are an ldap user' do
user.password_expires_at = Time.new(2002)
allow(user).to receive(:ldap_user?).and_return(true)
allow(controller).to receive(:current_user).and_return(user)
......
......@@ -9,7 +9,7 @@
sign_in(user)
end
it 'destroy should remove avatar from DB' do
it 'removes avatar from DB calling destroy' do
delete :destroy, group_id: group.path
@group = assigns(:group)
expect(@group.avatar.present?).to be_falsey
......
......@@ -15,7 +15,7 @@
end
describe "#create" do
it "should create group milestone with Chinese title" do
it "creates group milestone with Chinese title" do
post :create,
group_id: group.id,
milestone: { project_ids: [project.id, project2.id], title: title }
......
......@@ -8,7 +8,7 @@
controller.instance_variable_set(:@user, user)
end
it 'destroy should remove avatar from DB' do
it 'removes avatar from DB by calling destroy' do
delete :destroy
@user = assigns(:user)
expect(@user.avatar.present?).to be_falsey
......
......@@ -6,7 +6,7 @@
describe '#new' do
before { sign_in(user) }
it 'redirect to #index' do
it 'redirects to #index' do
get :new
expect(response).to redirect_to(profile_keys_path)
......@@ -15,7 +15,7 @@
describe "#get_keys" do
describe "non existant user" do
it "should generally not work" do
it "does not generally work" do
get :get_keys, username: 'not-existent'
expect(response).not_to be_success
......@@ -23,19 +23,19 @@
end
describe "user with no keys" do
it "should generally work" do
it "does generally work" do
get :get_keys, username: user.username
expect(response).to be_success
end
it "should render all keys separated with a new line" do
it "renders all keys separated with a new line" do
get :get_keys, username: user.username
expect(response.body).to eq("")
end
it "should respond with text/plain content type" do
it "responds with text/plain content type" do
get :get_keys, username: user.username
expect(response.content_type).to eq("text/plain")
end
......@@ -47,13 +47,13 @@
user.keys << create(:another_key)
end
it "should generally work" do
it "does generally work" do
get :get_keys, username: user.username
expect(response).to be_success
end
it "should render all keys separated with a new line" do
it "renders all keys separated with a new line" do
get :get_keys, username: user.username
expect(response.body).not_to eq("")
......@@ -65,13 +65,13 @@
expect(response.body).to match(/AQDmTillFzNTrrGgwaCKaSj/)
end
it "should not render the comment of the key" do
it "does not render the comment of the key" do
get :get_keys, username: user.username
expect(response.body).not_to match(/dummy@gitlab.com/)
end
it "should respond with text/plain content type" do
it "responds with text/plain content type" do
get :get_keys, username: user.username
expect(response.content_type).to eq("text/plain")
end
......
......@@ -10,7 +10,7 @@
controller.instance_variable_set(:@project, project)
end
it 'destroy should remove avatar from DB' do
it 'removes avatar from DB by calling destroy' do
delete :destroy, namespace_id: project.namespace.id, project_id: project.id
expect(project.avatar.present?).to be_falsey
expect(project).to be_valid
......
......@@ -47,25 +47,25 @@ def go(extra_params = {})
end
shared_examples "export as" do |format|
it "should generally work" do
it "does generally work" do
go(id: commit.id, format: format)
expect(response).to be_success
end
it "should generate it" do
it "generates it" do
expect_any_instance_of(Commit).to receive(:"to_#{format}")
go(id: commit.id, format: format)
end
it "should render it" do
it "renders it" do
go(id: commit.id, format: format)
expect(response.body).to eq(commit.send(:"to_#{format}"))
end
it "should not escape Html" do
it "does not escape Html" do
allow_any_instance_of(Commit).to receive(:"to_#{format}").
and_return('HTML entities &<>" ')
......@@ -88,7 +88,7 @@ def go(extra_params = {})
expect(response.body).to start_with("diff --git")
end
it "should really only be a git diff without whitespace changes" do
it "is only be a git diff without whitespace changes" do
go(id: '66eceea0db202bb39c4e445e8ca28689645366c5', format: format, w: 1)
expect(response.body).to start_with("diff --git")
......@@ -103,13 +103,13 @@ def go(extra_params = {})
include_examples "export as", :patch
let(:format) { :patch }
it "should really be a git email patch" do
it "is a git email patch" do
go(id: commit.id, format: format)
expect(response.body).to start_with("From #{commit.id}")
end
it "should contain a git diff" do
it "contains a git diff" do
go(id: commit.id, format: format)
expect(response.body).to match(/^diff --git/)
......@@ -147,7 +147,7 @@ def go(extra_params = {})
describe 'POST revert' do
context 'when target branch is not provided' do
it 'should render the 404 page' do
it 'renders the 404 page' do
post(:revert,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -159,7 +159,7 @@ def go(extra_params = {})
end
context 'when the revert was successful' do
it 'should redirect to the commits page' do
it 'redirects to the commits page' do
post(:revert,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -180,7 +180,7 @@ def go(extra_params = {})
id: commit.id)
end
it 'should redirect to the commit page' do
it 'redirects to the commit page' do
# Reverting a commit that has been already reverted.
post(:revert,
namespace_id: project.namespace.to_param,
......@@ -196,7 +196,7 @@ def go(extra_params = {})
describe 'POST cherry_pick' do
context 'when target branch is not provided' do
it 'should render the 404 page' do
it 'renders the 404 page' do
post(:cherry_pick,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -208,7 +208,7 @@ def go(extra_params = {})
end
context 'when the cherry-pick was successful' do
it 'should redirect to the commits page' do
it 'redirects to the commits page' do
post(:cherry_pick,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -229,7 +229,7 @@ def go(extra_params = {})
id: master_pickable_commit.id)
end
it 'should redirect to the commit page' do
it 'redirects to the commit page' do
# Cherry-picking a commit that has been already cherry-picked.
post(:cherry_pick,
namespace_id: project.namespace.to_param,
......
......@@ -11,7 +11,7 @@
describe "GET show" do
context "as atom feed" do
it "should render as atom" do
it "renders as atom" do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......
......@@ -11,7 +11,7 @@
project.team << [user, :master]
end
it 'compare should show some diffs' do
it 'compare shows some diffs' do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -23,7 +23,7 @@
expect(assigns(:commits).length).to be >= 1
end
it 'compare should show some diffs with ignore whitespace change option' do
it 'compare shows some diffs with ignore whitespace change option' do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -41,7 +41,7 @@
end
describe 'non-existent refs' do
it 'invalid source ref' do
it 'uses invalid source ref' do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -53,7 +53,7 @@
expect(assigns(:commits)).to eq([])
end
it 'invalid target ref' do
it 'uses invalid target ref' do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......
......@@ -16,7 +16,7 @@ def get_forks
context 'when fork is public' do
before { forked_project.update_attribute(:visibility_level, Project::PUBLIC) }
it 'should be visible for non logged in users' do
it 'is visible for non logged in users' do
get_forks
expect(assigns[:forks]).to be_present
......@@ -28,7 +28,7 @@ def get_forks
forked_project.update_attributes(visibility_level: Project::PRIVATE, group: group)
end
it 'should not be visible for non logged in users' do
it 'is not be visible for non logged in users' do
get_forks
expect(assigns[:forks]).to be_blank
......@@ -38,7 +38,7 @@ def get_forks
before { sign_in(project.creator) }
context 'when user is not a Project member neither a group member' do
it 'should not see the Project listed' do
it 'does not see the Project listed' do
get_forks
expect(assigns[:forks]).to be_blank
......@@ -48,7 +48,7 @@ def get_forks
context 'when user is a member of the Project' do
before { forked_project.team << [project.creator, :developer] }
it 'should see the project listed' do
it 'sees the project listed' do
get_forks
expect(assigns[:forks]).to be_present
......@@ -58,7 +58,7 @@ def get_forks
context 'when user is a member of the Group' do
before { forked_project.group.add_developer(project.creator) }
it 'should see the project listed' do
it 'sees the project listed' do
get_forks
expect(assigns[:forks]).to be_present
......
......@@ -30,7 +30,7 @@
expect(response).to have_http_status(200)
end
it "return 301 if request path doesn't match project path" do
it "returns 301 if request path doesn't match project path" do
get :index, namespace_id: project.namespace.path, project_id: project.path.upcase
expect(response).to redirect_to(namespace_project_issues_path(project.namespace, project))
......@@ -119,21 +119,21 @@ def move_issue
let!(:request_forgery_timing_attack) { create(:issue, :confidential, project: project, assignee: assignee) }
describe 'GET #index' do
it 'should not list confidential issues for guests' do
it 'does not list confidential issues for guests' do
sign_out(:user)
get_issues
expect(assigns(:issues)).to eq [issue]
end
it 'should not list confidential issues for non project members' do
it 'does not list confidential issues for non project members' do
sign_in(non_member)
get_issues
expect(assigns(:issues)).to eq [issue]
end
it 'should not list confidential issues for project members with guest role' do
it 'does not list confidential issues for project members with guest role' do
sign_in(member)
project.team << [member, :guest]
......@@ -142,7 +142,7 @@ def move_issue
expect(assigns(:issues)).to eq [issue]
end
it 'should list confidential issues for author' do
it 'lists confidential issues for author' do
sign_in(author)
get_issues
......@@ -150,7 +150,7 @@ def move_issue
expect(assigns(:issues)).not_to include request_forgery_timing_attack
end
it 'should list confidential issues for assignee' do
it 'lists confidential issues for assignee' do
sign_in(assignee)
get_issues
......@@ -158,7 +158,7 @@ def move_issue
expect(assigns(:issues)).to include request_forgery_timing_attack
end
it 'should list confidential issues for project members' do
it 'lists confidential issues for project members' do
sign_in(member)
project.team << [member, :developer]
......@@ -168,7 +168,7 @@ def move_issue
expect(assigns(:issues)).to include request_forgery_timing_attack
end
it 'should list confidential issues for admin' do
it 'lists confidential issues for admin' do
sign_in(admin)
get_issues
......
......@@ -36,7 +36,7 @@
describe "GET show" do
shared_examples "export merge as" do |format|
it "should generally work" do
it "does generally work" do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -46,7 +46,7 @@
expect(response).to be_success
end
it "should generate it" do
it "generates it" do
expect_any_instance_of(MergeRequest).to receive(:"to_#{format}")
get(:show,
......@@ -56,7 +56,7 @@
format: format)
end
it "should render it" do
it "renders it" do
get(:show,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
......@@ -66,7 +66,7 @@
expect(response.body).to eq(merge_request.send(:"to_#{format}").to_s)
end
it "should not escape Html" do
it "does not escape Html" do
allow_any_instance_of(MergeRequest).to receive(:"to_#{format}").
and_return('HTML entities &<>" ')
......@@ -118,7 +118,7 @@ def get_merge_requests
context 'when filtering by opened state' do
context 'with opened merge requests' do
it 'should list those merge requests' do
it 'lists those merge requests' do
get_merge_requests
expect(assigns(:merge_requests)).to include(merge_request)
......@@ -131,7 +131,7 @@ def get_merge_requests
merge_request.reopen!
end
it 'should list those merge requests' do
it 'lists those merge requests' do
get_merge_requests
expect(assigns(:merge_requests)).to include(merge_request)
......
......@@ -14,7 +14,7 @@
end
describe "#destroy" do
it "should remove milestone" do
it "removes milestone" do
expect(issue.milestone_id).to eq(milestone.id)
delete :destroy, namespace_id: project.namespace.id, project_id: project.id, id: milestone.iid, format: :js
......
......@@ -167,7 +167,7 @@
sign_in(user)
end
it 'cannot remove himself from the project' do
it 'does not remove himself from the project' do
delete :leave, namespace_id: project.namespace,
project_id: project
......
......@@ -3,7 +3,7 @@
describe Projects::ProtectedBranchesController do
describe "GET #index" do
let(:project) { create(:project_empty_repo, :public) }
it "redirect empty repo to projects page" do
it "redirects empty repo to projects page" do
get(:index, namespace_id: project.namespace.to_param, project_id: project.to_param)
end
end
......
......@@ -24,7 +24,7 @@
context 'image header' do
let(:id) { 'master/files/images/6049019_460s.jpg' }
it 'set image content type header' do
it 'sets image content type header' do
get(:show,
namespace_id: public_project.namespace.to_param,
project_id: public_project.to_param,
......
......@@ -19,7 +19,7 @@
describe "#test" do
context 'success' do
it "should redirect and show success message" do
it "redirects and show success message" do
expect(service).to receive(:test).and_return({ success: true, result: 'done' })
get :test, namespace_id: project.namespace.id, project_id: project.id, id: service.id, format: :html
expect(response.status).to redirect_to('/')
......@@ -28,7 +28,7 @@
end
context 'failure' do
it "should redirect and show failure message" do
it "redirects and show failure message" do
expect(service).to receive(:test).and_return({ success: false, result: 'Bad test' })
get :test, namespace_id: project.namespace.id, project_id: project.id, id: service.id, format: :html
expect(response.status).to redirect_to('/')
......
......@@ -128,7 +128,7 @@
context "when the url contains .atom" do
let(:public_project_with_dot_atom) { build(:project, :public, name: 'my.atom', path: 'my.atom') }
it 'expect an error creating the project' do
it 'expects an error creating the project' do
expect(public_project_with_dot_atom).not_to be_valid
end
end
......@@ -222,7 +222,7 @@
create(:forked_project_link, forked_to_project: project_fork)
end
it 'should remove fork from project' do
it 'removes fork from project' do
delete(:remove_fork,
namespace_id: project_fork.namespace.to_param,
id: project_fork.to_param, format: :js)
......@@ -236,7 +236,7 @@
context 'when project not forked' do
let(:unforked_project) { create(:project, namespace: user.namespace) }
it 'should do nothing if project was not forked' do
it 'does nothing if project was not forked' do
delete(:remove_fork,
namespace_id: unforked_project.namespace.to_param,
id: unforked_project.to_param, format: :js)
......@@ -256,7 +256,7 @@
end
describe "GET refs" do
it "should get a list of branches and tags" do
it "gets a list of branches and tags" do
get :refs, namespace_id: public_project.namespace.path, id: public_project.path
parsed_body = JSON.parse(response.body)
......@@ -265,7 +265,7 @@
expect(parsed_body["Commits"]).to be_nil
end
it "should get a list of branches, tags and commits" do
it "gets a list of branches, tags and commits" do
get :refs, namespace_id: public_project.namespace.path, id: public_project.path, ref: "123456"
parsed_body = JSON.parse(response.body)
......
......@@ -11,7 +11,7 @@
end
describe 'in the abuse report view' do
it "should present a link to the user's profile" do
it "presents a link to the user's profile" do
visit admin_abuse_reports_path
expect(page).to have_link user.name, href: user_path(user)
......@@ -19,7 +19,7 @@
end
describe 'in the profile page of the user' do
it 'should show a link to the admin view of the user' do
it 'shows a link to the admin view of the user' do
visit user_path(user)
expect(page).to have_link '', href: admin_user_path(user)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment