summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-06-07 08:39:02 +0100
committerPhil Hughes <me@iamphill.com>2017-06-07 08:39:02 +0100
commit1633d3d7d8b8589a3d04358d6473cfd168633a10 (patch)
treea0325e21d56b55aa870181477e8bb965527fb8d3 /spec
parent973e8c0fc50bc6614ca42413555a3f73625c7efa (diff)
downloadgitlab-ce-1633d3d7d8b8589a3d04358d6473cfd168633a10.tar.gz
change tests based on backend feedbackexpand-backlog-closed-lists-issue-boards
Diffstat (limited to 'spec')
-rw-r--r--spec/services/boards/lists/list_service_spec.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/spec/services/boards/lists/list_service_spec.rb b/spec/services/boards/lists/list_service_spec.rb
index 99016a8be0c..68140759600 100644
--- a/spec/services/boards/lists/list_service_spec.rb
+++ b/spec/services/boards/lists/list_service_spec.rb
@@ -9,26 +9,20 @@ describe Boards::Lists::ListService, services: true do
describe '#execute' do
context 'when the board has a backlog list' do
- before do
- create(:backlog_list, board: board)
- end
+ let!(:backlog_list) { create(:backlog_list, board: board) }
it 'does not create a backlog list' do
- service.execute(board)
-
- expect(board.lists.merge(List.backlog)).to eq [board.backlog_list]
+ expect { service.execute(board) }.not_to change(board.lists, :count)
end
it "returns board's lists" do
- expect(service.execute(board)).to eq [board.backlog_list, list, board.closed_list]
+ expect(service.execute(board)).to eq [backlog_list, list, board.closed_list]
end
end
context 'when the board does not have a backlog list' do
it 'creates a backlog list' do
- service.execute(board)
-
- expect(board.backlog_list).not_to be nil
+ expect { service.execute(board) }.to change(board.lists, :count).by(1)
end
it "returns board's lists" do