diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-02-26 09:32:07 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-02-26 09:32:07 -0500 |
commit | 08ec838ed501473846806be2680e8888ff859e10 (patch) | |
tree | 4a4664c505d667db907084bd8850cd689f338f7e /spec | |
parent | b2dcfc4db3828888f9aa0a9cc38e89fe84d30b2c (diff) | |
parent | f150b8a5b9a6f56151523061813bad2cf48c9d91 (diff) | |
download | gitlab-ce-08ec838ed501473846806be2680e8888ff859e10.tar.gz |
Merge branch 'master' into avatar-croppingavatar-cropping
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/ci/builds.rb | 6 | ||||
-rw-r--r-- | spec/services/todo_service_spec.rb | 10 | ||||
-rw-r--r-- | spec/support/capybara.rb | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index a46466798d6..a7a54d44521 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -53,6 +53,10 @@ FactoryGirl.define do tag true end + factory :ci_build_with_coverage do + coverage 99.9 + end + trait :trace do after(:create) do |build, evaluator| build.trace = 'BUILD TRACE' @@ -68,7 +72,7 @@ FactoryGirl.define do build.artifacts_metadata = fixture_file_upload(Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip') - + build.save! end end diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index df3aa955f24..96420acb31d 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -110,6 +110,8 @@ describe TodoService, services: true do let!(:first_todo) { create(:todo, :assigned, user: john_doe, project: project, target: issue, author: author) } let!(:second_todo) { create(:todo, :assigned, user: john_doe, project: project, target: issue, author: author) } let(:note) { create(:note, project: project, noteable: issue, author: john_doe, note: mentions) } + let(:note_on_commit) { create(:note_on_commit, project: project, author: john_doe, note: mentions) } + let(:note_on_project_snippet) { create(:note_on_project_snippet, project: project, author: john_doe, note: mentions) } let(:award_note) { create(:note, :award, project: project, noteable: issue, author: john_doe, note: 'thumbsup') } let(:system_note) { create(:system_note, project: project, noteable: issue) } @@ -145,6 +147,14 @@ describe TodoService, services: true do should_not_create_todo(user: john_doe, target: issue, author: john_doe, action: Todo::MENTIONED, note: note) should_not_create_todo(user: stranger, target: issue, author: john_doe, action: Todo::MENTIONED, note: note) end + + it 'does not create todo when leaving a note on commit' do + should_not_create_any_todo { service.new_note(note_on_commit, john_doe) } + end + + it 'does not create todo when leaving a note on snippet' do + should_not_create_any_todo { service.new_note(note_on_project_snippet, john_doe) } + end end end diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index a698f484df1..65d59e6813c 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -7,7 +7,7 @@ timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 10 Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout) + Capybara::Poltergeist::Driver.new(app, js_errors: true, timeout: timeout, window_size: [1366, 768]) end Capybara.default_wait_time = timeout |