change tests based on backend feedback
This commit is contained in:
parent
973e8c0fc5
commit
1633d3d7d8
1 changed files with 4 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue