summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-04-06 13:47:05 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-04-06 13:47:05 +0200
commit5cf56e56470e695b10db02dff70d0f0b50060518 (patch)
treed46ecd17857f8e49abda15c03576c099e2bf39df /spec
parente3558ed67e7e829fe5148c3fb2fe80ed045fe1b4 (diff)
downloadgitlab-ce-5cf56e56470e695b10db02dff70d0f0b50060518.tar.gz
Rename almost all the things
Diffstat (limited to 'spec')
-rw-r--r--spec/features/admin/admin_projects_spec.rb24
-rw-r--r--spec/mailers/repository_check_mailer_spec.rb (renamed from spec/mailers/repo_check_mailer_spec.rb)2
-rw-r--r--spec/workers/repo_check_worker_spec.rb31
-rw-r--r--spec/workers/repository_check_worker_spec.rb31
4 files changed, 44 insertions, 44 deletions
diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb
index e3991d48ed6..95a230a72c3 100644
--- a/spec/features/admin/admin_projects_spec.rb
+++ b/spec/features/admin/admin_projects_spec.rb
@@ -33,33 +33,33 @@ describe "Admin Projects", feature: true do
end
end
- feature 'repo checks' do
- scenario 'trigger repo check' do
+ feature 'repository checks' do
+ scenario 'trigger repository check' do
visit_admin_project_page
- page.within('.repo-check') do
- click_button 'Trigger repo check'
+ page.within('.repository-check') do
+ click_button 'Trigger repository check'
end
- expect(page).to have_content('Repo check was triggered')
+ expect(page).to have_content('Repository check was triggered')
end
- scenario 'see failed repo check' do
- @project.update_column(:last_repo_check_failed, true)
+ scenario 'see failed repository check' do
+ @project.update_column(:last_repository_check_failed, true)
visit_admin_project_page
- expect(page).to have_content('Last repo check failed')
+ expect(page).to have_content('Last repository check failed')
end
- scenario 'clear repo checks', js: true do
- @project.update_column(:last_repo_check_failed, true)
+ scenario 'clear repository checks', js: true do
+ @project.update_column(:last_repository_check_failed, true)
visit admin_namespaces_projects_path
- page.within('.repo-check-states') do
+ page.within('.repository-check-states') do
click_link 'Clear all' # pop-up should be auto confirmed
end
- expect(@project.reload.last_repo_check_failed).to eq(false)
+ expect(@project.reload.last_repository_check_failed).to eq(false)
end
end
diff --git a/spec/mailers/repo_check_mailer_spec.rb b/spec/mailers/repository_check_mailer_spec.rb
index d49a6ae0c05..6ae9a93aaac 100644
--- a/spec/mailers/repo_check_mailer_spec.rb
+++ b/spec/mailers/repository_check_mailer_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-describe RepoCheckMailer do
+describe RepositoryCheckMailer do
include EmailSpec::Matchers
describe '.notify' do
diff --git a/spec/workers/repo_check_worker_spec.rb b/spec/workers/repo_check_worker_spec.rb
deleted file mode 100644
index 7ef3eba9ac5..00000000000
--- a/spec/workers/repo_check_worker_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'spec_helper'
-
-describe RepoCheckWorker do
- subject { RepoCheckWorker.new }
-
- it 'prefers projects that have never been checked' do
- projects = 3.times.map { create(:project) }
- projects[0].update_column(:last_repo_check_at, 1.month.ago)
- projects[2].update_column(:last_repo_check_at, 3.weeks.ago)
-
- expect(subject.perform).to eq(projects.values_at(1, 0, 2).map(&:id))
- end
-
- it 'sorts projects by last_repo_check_at' do
- projects = 3.times.map { create(:project) }
- projects[0].update_column(:last_repo_check_at, 2.weeks.ago)
- projects[1].update_column(:last_repo_check_at, 1.month.ago)
- projects[2].update_column(:last_repo_check_at, 3.weeks.ago)
-
- expect(subject.perform).to eq(projects.values_at(1, 2, 0).map(&:id))
- end
-
- it 'excludes projects that were checked recently' do
- projects = 3.times.map { create(:project) }
- projects[0].update_column(:last_repo_check_at, 2.days.ago)
- projects[1].update_column(:last_repo_check_at, 1.month.ago)
- projects[2].update_column(:last_repo_check_at, 3.days.ago)
-
- expect(subject.perform).to eq([projects[1].id])
- end
-end
diff --git a/spec/workers/repository_check_worker_spec.rb b/spec/workers/repository_check_worker_spec.rb
new file mode 100644
index 00000000000..d1849321f56
--- /dev/null
+++ b/spec/workers/repository_check_worker_spec.rb
@@ -0,0 +1,31 @@
+require 'spec_helper'
+
+describe RepositoryCheckWorker do
+ subject { RepositoryCheckWorker.new }
+
+ it 'prefers projects that have never been checked' do
+ projects = 3.times.map { create(:project) }
+ projects[0].update_column(:last_repository_check_at, 1.month.ago)
+ projects[2].update_column(:last_repository_check_at, 3.weeks.ago)
+
+ expect(subject.perform).to eq(projects.values_at(1, 0, 2).map(&:id))
+ end
+
+ it 'sorts projects by last_repository_check_at' do
+ projects = 3.times.map { create(:project) }
+ projects[0].update_column(:last_repository_check_at, 2.weeks.ago)
+ projects[1].update_column(:last_repository_check_at, 1.month.ago)
+ projects[2].update_column(:last_repository_check_at, 3.weeks.ago)
+
+ expect(subject.perform).to eq(projects.values_at(1, 2, 0).map(&:id))
+ end
+
+ it 'excludes projects that were checked recently' do
+ projects = 3.times.map { create(:project) }
+ projects[0].update_column(:last_repository_check_at, 2.days.ago)
+ projects[1].update_column(:last_repository_check_at, 1.month.ago)
+ projects[2].update_column(:last_repository_check_at, 3.days.ago)
+
+ expect(subject.perform).to eq([projects[1].id])
+ end
+end