Commit 42ce775d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge remote-tracking branch 'ee-com/master' into ce-to-ee

parents 4ba1a3b8 f7112776
......@@ -85,5 +85,11 @@
= custom_icon('authentication_log')
%span.nav-item-name
Authentication log
= nav_link(path: 'profiles#pipeline_quota') do
= link_to profile_pipeline_quota_path, title: 'Pipeline quota' do
.nav-icon-container
= custom_icon('pipeline')
%span
Pipeline quota
= render 'shared/sidebar_toggle_button'
......@@ -13,8 +13,11 @@ describe 'Issue Boards', :js do
let!(:list) { create(:list, board: board, label: development, position: 0) }
let(:card) { find('.board:nth-child(2)').first('.card') }
around do |example|
Timecop.freeze { example.run }
end
before do
Timecop.freeze
stub_licensed_features(multiple_issue_assignees: true)
project.team << [user, :master]
......@@ -26,10 +29,6 @@ describe 'Issue Boards', :js do
wait_for_requests
end
after do
Timecop.return
end
context 'assignee' do
it 'updates the issues assignee' do
click_card(card)
......
......@@ -8,16 +8,12 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do
subject { background_migration.perform(cutoff_datetime) }
context 'when an SSH key was created after the cutoff datetime' do
before do
Timecop.freeze
end
after do
Timecop.return
end
around do |example|
Timecop.travel(1.day.from_now) { example.run }
end
context 'when an SSH key was created after the cutoff datetime' do
before do
Timecop.travel 1.day.from_now
@key = create(:key)
end
......@@ -38,16 +34,12 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do
subject { background_migration.add_keys_since(cutoff_datetime) }
before do
Timecop.freeze
end
after do
Timecop.return
around do |example|
Timecop.travel(1.day.from_now) { example.run }
end
context 'when an SSH key was created after the cutoff datetime' do
before do
Timecop.travel 1.day.from_now
@key = create(:key)
create(:key) # other key
end
......
......@@ -21,20 +21,16 @@ describe UpdateAuthorizedKeysFile, :migration do
end
context 'there are keys created before and after the cutoff datetime' do
before do
Timecop.freeze
end
after do
Timecop.return
end
before do
@cutoff_datetime = UpdateAuthorizedKeysFile::DATETIME_9_3_0_RELEASED
@keys = []
Timecop.travel(@cutoff_datetime - 1.day)
2.times { @keys << create(:key) } # 2 keys before cutoff
Timecop.travel(@cutoff_datetime + 1.day)
2.times { @keys << create(:key) } # 2 keys after cutoff
Timecop.travel(@cutoff_datetime - 1.day) do
2.times { @keys << create(:key) } # 2 keys before cutoff
end
Timecop.travel(@cutoff_datetime + 1.day) do
2.times { @keys << create(:key) } # 2 keys after cutoff
end
end
it 'adds the keys created after the cutoff datetime to the authorized_keys file' do
......
......@@ -18,15 +18,17 @@ describe Burndown do
}
end
around do |example|
Timecop.travel(due_date) do
example.run
end
end
before do
project.add_master(user)
build_sample
end
after do
Timecop.return
end
subject { described_class.new(milestone).to_json }
it "generates an array with date, issue count and weight" do
......@@ -52,9 +54,9 @@ describe Burndown do
end
it "it counts until today if milestone due date > Date.today" do
Timecop.travel(milestone.due_date - 1.day)
expect(JSON.parse(subject).last[0]).to eq(Time.now.strftime("%Y-%m-%d"))
Timecop.travel(milestone.due_date - 1.day) do
expect(JSON.parse(subject).last[0]).to eq(Time.now.strftime("%Y-%m-%d"))
end
end
it "sets attribute accurate to true" do
......@@ -104,19 +106,17 @@ describe Burndown do
next if day.even?
count = day * 4
Timecop.travel(date)
Timecop.travel(date) do
# Create issues
issues = create_list(:issue, count, issue_params)
# Create issues
issues = create_list(:issue, count, issue_params)
# Close issues
closed = issues.slice(0..count / 2)
closed.each(&:close)
# Close issues
closed = issues.slice(0..count / 2)
closed.each(&:close)
# Reopen issues
closed.slice(0..count / 4).each(&:reopen)
# Reopen issues
closed.slice(0..count / 4).each(&:reopen)
end
end
Timecop.travel(due_date)
end
end
......@@ -88,12 +88,8 @@ describe RemoteMirror do
context '#sync' do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
before do
Timecop.freeze(Time.now)
end
after do
Timecop.return
around do |example|
Timecop.freeze { example.run }
end
context 'repository mirrors not licensed' do
......@@ -145,13 +141,12 @@ describe RemoteMirror do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
let(:timestamp) { Time.now - 5.minutes }
before do
Timecop.freeze(Time.now)
remote_mirror.update_attributes(last_update_started_at: Time.now)
around do |example|
Timecop.freeze { example.run }
end
after do
Timecop.return
before do
remote_mirror.update_attributes(last_update_started_at: Time.now)
end
context 'when remote mirror does not have status failed' do
......
......@@ -6,12 +6,8 @@ describe RepositoryUpdateRemoteMirrorWorker do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
let(:scheduled_time) { Time.now - 5.minutes }
before do
Timecop.freeze(Time.now)
end
after do
Timecop.return
around do |example|
Timecop.freeze(Time.now) { example.run }
end
describe '#perform' do
......
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