Skip to content
Snippets Groups Projects
Commit 519275c1 authored by tiagonbotelho's avatar tiagonbotelho
Browse files

fixes part1 of files to start using active tense

parent 551ffc0a
No related branches found
No related tags found
No related merge requests found
Showing
with 67 additions and 67 deletions
Loading
Loading
@@ -39,7 +39,7 @@ describe Admin::UsersController do
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
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ describe ApplicationController do
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)
Loading
Loading
@@ -14,7 +14,7 @@ describe ApplicationController do
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)
Loading
Loading
@@ -22,7 +22,7 @@ describe ApplicationController do
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)
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ describe Groups::AvatarsController do
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
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@ describe Groups::MilestonesController do
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 }
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ describe Profiles::AvatarsController do
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
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ describe Profiles::KeysController do
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)
Loading
Loading
@@ -15,7 +15,7 @@ describe Profiles::KeysController do
 
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
Loading
Loading
@@ -23,19 +23,19 @@ describe Profiles::KeysController do
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
Loading
Loading
@@ -47,13 +47,13 @@ describe Profiles::KeysController do
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("")
Loading
Loading
@@ -65,13 +65,13 @@ describe Profiles::KeysController do
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
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ describe Projects::AvatarsController do
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
Loading
Loading
Loading
Loading
@@ -47,25 +47,25 @@ describe Projects::CommitController do
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 &<>" ')
 
Loading
Loading
@@ -88,7 +88,7 @@ describe Projects::CommitController do
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")
Loading
Loading
@@ -103,13 +103,13 @@ describe Projects::CommitController do
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/)
Loading
Loading
@@ -147,7 +147,7 @@ describe Projects::CommitController do
 
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,
Loading
Loading
@@ -159,7 +159,7 @@ describe Projects::CommitController do
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,
Loading
Loading
@@ -180,7 +180,7 @@ describe Projects::CommitController do
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,
Loading
Loading
@@ -196,7 +196,7 @@ describe Projects::CommitController do
 
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,
Loading
Loading
@@ -208,7 +208,7 @@ describe Projects::CommitController do
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,
Loading
Loading
@@ -229,7 +229,7 @@ describe Projects::CommitController do
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,
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe Projects::CommitsController do
 
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,
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe Projects::CompareController do
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,
Loading
Loading
@@ -23,7 +23,7 @@ describe Projects::CompareController do
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,
Loading
Loading
@@ -41,7 +41,7 @@ describe Projects::CompareController do
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,
Loading
Loading
@@ -53,7 +53,7 @@ describe Projects::CompareController do
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,
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe Projects::ForksController do
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
Loading
Loading
@@ -28,7 +28,7 @@ describe Projects::ForksController do
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
Loading
Loading
@@ -38,7 +38,7 @@ describe Projects::ForksController do
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
Loading
Loading
@@ -48,7 +48,7 @@ describe Projects::ForksController do
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
Loading
Loading
@@ -58,7 +58,7 @@ describe Projects::ForksController do
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
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@ describe Projects::IssuesController do
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))
Loading
Loading
@@ -119,21 +119,21 @@ describe Projects::IssuesController do
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]
 
Loading
Loading
@@ -142,7 +142,7 @@ describe Projects::IssuesController do
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
 
Loading
Loading
@@ -150,7 +150,7 @@ describe Projects::IssuesController do
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
 
Loading
Loading
@@ -158,7 +158,7 @@ describe Projects::IssuesController do
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]
 
Loading
Loading
@@ -168,7 +168,7 @@ describe Projects::IssuesController do
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
 
Loading
Loading
Loading
Loading
@@ -36,7 +36,7 @@ describe Projects::MergeRequestsController do
 
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,
Loading
Loading
@@ -46,7 +46,7 @@ describe Projects::MergeRequestsController do
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,
Loading
Loading
@@ -56,7 +56,7 @@ describe Projects::MergeRequestsController do
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,
Loading
Loading
@@ -66,7 +66,7 @@ describe Projects::MergeRequestsController do
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 &<>" ')
 
Loading
Loading
@@ -118,7 +118,7 @@ describe Projects::MergeRequestsController do
 
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)
Loading
Loading
@@ -131,7 +131,7 @@ describe Projects::MergeRequestsController do
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)
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ describe Projects::MilestonesController do
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
Loading
Loading
Loading
Loading
@@ -167,7 +167,7 @@ describe Projects::ProjectMembersController do
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
 
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ require('spec_helper')
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
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@ describe Projects::RawController do
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,
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ describe Projects::ServicesController do
 
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('/')
Loading
Loading
@@ -28,7 +28,7 @@ describe Projects::ServicesController do
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('/')
Loading
Loading
Loading
Loading
@@ -128,7 +128,7 @@ describe ProjectsController do
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
Loading
Loading
@@ -222,7 +222,7 @@ describe ProjectsController do
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)
Loading
Loading
@@ -236,7 +236,7 @@ describe ProjectsController do
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)
Loading
Loading
@@ -256,7 +256,7 @@ describe ProjectsController do
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)
Loading
Loading
@@ -265,7 +265,7 @@ describe ProjectsController do
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)
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
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)
Loading
Loading
@@ -19,7 +19,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
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)
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