Commit 1633d3d7 authored by Phil Hughes's avatar Phil Hughes

change tests based on backend feedback

parent 973e8c0f
...@@ -9,26 +9,20 @@ describe Boards::Lists::ListService, services: true do ...@@ -9,26 +9,20 @@ describe Boards::Lists::ListService, services: true do
describe '#execute' do describe '#execute' do
context 'when the board has a backlog list' do context 'when the board has a backlog list' do
before do let!(:backlog_list) { create(:backlog_list, board: board) }
create(:backlog_list, board: board)
end
it 'does not create a backlog list' do it 'does not create a backlog list' do
service.execute(board) expect { service.execute(board) }.not_to change(board.lists, :count)
expect(board.lists.merge(List.backlog)).to eq [board.backlog_list]
end end
it "returns board's lists" do 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
end end
context 'when the board does not have a backlog list' do context 'when the board does not have a backlog list' do
it 'creates a backlog list' do it 'creates a backlog list' do
service.execute(board) expect { service.execute(board) }.to change(board.lists, :count).by(1)
expect(board.backlog_list).not_to be nil
end end
it "returns board's lists" do it "returns board's lists" 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