diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-27 08:27:45 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-27 08:27:45 +0300 |
commit | fa54a486eb6d6a71b015fce72decf33b011a0b2d (patch) | |
tree | 84485ca83b12a7956697994ba181d93fe0d29eb0 /spec | |
parent | 54247af5a9991286dc19248178c3d038803b57b4 (diff) | |
parent | 0f6c42c5ce165dadf1976ae15a043b87ca533618 (diff) |
Merge branch '53811-issue-boards-to-core-projects-backend-ce' into 'master'
Move Multiple Issue Boards for Projects to Core
See merge request gitlab-org/gitlab-ce!29757
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/groups/boards_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/projects/boards_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/boards/visits_finder_spec.rb (renamed from spec/services/boards/visits/latest_service_spec.rb) | 24 | ||||
-rw-r--r-- | spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/spec/controllers/groups/boards_controller_spec.rb b/spec/controllers/groups/boards_controller_spec.rb index 881d0018b79..5e0f64ccca4 100644 --- a/spec/controllers/groups/boards_controller_spec.rb +++ b/spec/controllers/groups/boards_controller_spec.rb @@ -59,7 +59,7 @@ describe Groups::BoardsController do it 'return an array with one group board' do create(:board, group: group) - expect(Boards::Visits::LatestService).not_to receive(:new) + expect(Boards::VisitsFinder).not_to receive(:new) list_boards format: :json diff --git a/spec/controllers/projects/boards_controller_spec.rb b/spec/controllers/projects/boards_controller_spec.rb index ae85000b4e0..c07afc57aea 100644 --- a/spec/controllers/projects/boards_controller_spec.rb +++ b/spec/controllers/projects/boards_controller_spec.rb @@ -65,7 +65,7 @@ describe Projects::BoardsController do it 'returns a list of project boards' do create_list(:board, 2, project: project) - expect(Boards::Visits::LatestService).not_to receive(:new) + expect(Boards::VisitsFinder).not_to receive(:new) list_boards format: :json diff --git a/spec/services/boards/visits/latest_service_spec.rb b/spec/finders/boards/visits_finder_spec.rb index c8a0a5e4243..4d40f4826f8 100644 --- a/spec/services/boards/visits/latest_service_spec.rb +++ b/spec/finders/boards/visits_finder_spec.rb @@ -2,32 +2,32 @@ require 'spec_helper' -describe Boards::Visits::LatestService do - describe '#execute' do +describe Boards::VisitsFinder do + describe '#latest' do let(:user) { create(:user) } context 'when a project board' do let(:project) { create(:project) } let(:project_board) { create(:board, project: project) } - subject(:service) { described_class.new(project_board.parent, user) } + subject(:finder) { described_class.new(project_board.parent, user) } it 'returns nil when there is no user' do - service.current_user = nil + finder.current_user = nil - expect(service.execute).to eq nil + expect(finder.execute).to eq nil end it 'queries for most recent visit' do expect(BoardProjectRecentVisit).to receive(:latest).once - service.execute + finder.execute end it 'queries for last N visits' do expect(BoardProjectRecentVisit).to receive(:latest).with(user, project, count: 5).once - described_class.new(project_board.parent, user, count: 5).execute + described_class.new(project_board.parent, user).latest(5) end end @@ -35,24 +35,24 @@ describe Boards::Visits::LatestService do let(:group) { create(:group) } let(:group_board) { create(:board, group: group) } - subject(:service) { described_class.new(group_board.parent, user) } + subject(:finder) { described_class.new(group_board.parent, user) } it 'returns nil when there is no user' do - service.current_user = nil + finder.current_user = nil - expect(service.execute).to eq nil + expect(finder.execute).to eq nil end it 'queries for most recent visit' do expect(BoardGroupRecentVisit).to receive(:latest).once - service.execute + finder.latest end it 'queries for last N visits' do expect(BoardGroupRecentVisit).to receive(:latest).with(user, group, count: 5).once - described_class.new(group_board.parent, user, count: 5).execute + described_class.new(group_board.parent, user).latest(5) end end end diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb index c6c10001bc5..2befbcb3370 100644 --- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb +++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb @@ -17,7 +17,7 @@ describe 'layouts/nav/sidebar/_project' do it 'has board tab' do render - expect(rendered).to have_css('a[title="Board"]') + expect(rendered).to have_css('a[title="Boards"]') end end |