Merge branch 'master' into fixes/api
This commit is contained in:
commit
375caeefcf
29 changed files with 224 additions and 94 deletions
|
@ -123,7 +123,7 @@ FactoryGirl.define do
|
|||
factory :event do
|
||||
factory :closed_issue_event do
|
||||
project
|
||||
action Event::Closed
|
||||
action { Event::Closed }
|
||||
target factory: :closed_issue
|
||||
author factory: :user
|
||||
end
|
||||
|
|
|
@ -115,6 +115,11 @@ describe Gitlab::API do
|
|||
json_response['commit']['id'].should == '621491c677087aa243f165eab467bfdfbee00be1'
|
||||
json_response['protected'].should == false
|
||||
end
|
||||
|
||||
it "should return a 404 error if branch is not available" do
|
||||
get api("/projects/#{project.id}/repository/branches/unknown", user)
|
||||
response.status.should == 404
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT /projects/:id/repository/branches/:branch/protect" do
|
||||
|
|
48
spec/requests/profile_spec.rb
Normal file
48
spec/requests/profile_spec.rb
Normal file
|
@ -0,0 +1,48 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "Profile account page" do
|
||||
let(:user) { create(:user) }
|
||||
|
||||
before do
|
||||
login_as :user
|
||||
end
|
||||
|
||||
describe "when signup is enabled" do
|
||||
before do
|
||||
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
|
||||
visit account_profile_path
|
||||
end
|
||||
it { page.should have_content("Remove account") }
|
||||
|
||||
it "should delete the account", js: true do
|
||||
expect { click_link "Delete account" }.to change {User.count}.by(-1)
|
||||
current_path.should == new_user_session_path
|
||||
end
|
||||
end
|
||||
|
||||
describe "when signup is enabled and user has a project" do
|
||||
before do
|
||||
Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
|
||||
@project = create(:project, namespace: @user.namespace)
|
||||
@project.team << [@user, :master]
|
||||
visit account_profile_path
|
||||
end
|
||||
it { page.should have_content("Remove account") }
|
||||
|
||||
it "should not allow user to delete the account" do
|
||||
expect { click_link "Delete account" }.not_to change {User.count}.by(-1)
|
||||
end
|
||||
end
|
||||
|
||||
describe "when signup is disabled" do
|
||||
before do
|
||||
Gitlab.config.gitlab.stub(:signup_enabled).and_return(false)
|
||||
visit account_profile_path
|
||||
end
|
||||
|
||||
it "should not have option to remove account" do
|
||||
page.should_not have_content("Remove account")
|
||||
current_path.should == account_profile_path
|
||||
end
|
||||
end
|
||||
end
|
|
@ -392,6 +392,7 @@ end
|
|||
describe BlobController, "routing" do
|
||||
it "to #show" do
|
||||
get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
|
||||
get("/gitlabhq/blob/master/app/models/compare.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/compare.rb')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue