GitLab steht Mittwoch, den 08. Juli, zwischen 09:00 und 13:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit e0e88cdd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tests

parent 90dc5ff5
......@@ -209,6 +209,7 @@ describe User do
describe 'without defaults' do
let(:user) { User.new }
it "should not apply defaults to user" do
user.projects_limit.should == 10
user.can_create_group.should be_true
......@@ -218,19 +219,21 @@ describe User do
context 'as admin' do
describe 'with defaults' do
let(:user) { User.build_user({}, as: :admin) }
it "should apply defaults to user" do
user.projects_limit.should == 42
user.can_create_group.should be_false
user.theme_id.should == Gitlab::Theme::BASIC
user.theme_id.should == Gitlab::Theme::MARS
end
end
describe 'with default overrides' do
let(:user) { User.build_user({projects_limit: 123, can_create_group: true, can_create_team: true, theme_id: Gitlab::Theme::MARS}, as: :admin) }
let(:user) { User.build_user({projects_limit: 123, can_create_group: true, can_create_team: true, theme_id: Gitlab::Theme::BASIC}, as: :admin) }
it "should apply defaults to user" do
user.projects_limit.should == 123
user.can_create_group.should be_true
user.theme_id.should == Gitlab::Theme::MARS
user.theme_id.should == Gitlab::Theme::BASIC
end
end
end
......@@ -238,26 +241,29 @@ describe User do
context 'as user' do
describe 'with defaults' do
let(:user) { User.build_user }
it "should apply defaults to user" do
user.projects_limit.should == 42
user.can_create_group.should be_false
user.theme_id.should == Gitlab::Theme::BASIC
user.theme_id.should == Gitlab::Theme::MARS
end
end
describe 'with default overrides' do
let(:user) { User.build_user(projects_limit: 123, can_create_group: true, theme_id: Gitlab::Theme::MARS) }
let(:user) { User.build_user(projects_limit: 123, can_create_group: true, theme_id: Gitlab::Theme::BASIC) }
it "should apply defaults to user" do
user.projects_limit.should == 42
user.can_create_group.should be_false
user.theme_id.should == Gitlab::Theme::BASIC
user.theme_id.should == Gitlab::Theme::MARS
end
end
end
end
describe 'by_username_or_id' do
let(:user1){create(:user, username: 'foo')}
let(:user1) { create(:user, username: 'foo') }
it "should get the correct user" do
User.by_username_or_id(user1.id).should == user1
User.by_username_or_id('foo').should == user1
......
......@@ -66,7 +66,7 @@ describe API::API do
}.to change { User.count }.by(1)
user = User.find_by_username(attr[:username])
user.projects_limit.should == limit
user.theme_id.should == Gitlab::Theme::BASIC
user.theme_id.should == Gitlab::Theme::MARS
Gitlab.config.gitlab.unstub(:default_projects_limit)
end
......
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