mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:29:54 +01:00
Add test for unpinning when the answer is not pinned
This commit is contained in:
parent
baea942975
commit
dd8f51160f
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,15 @@ describe UseCase::Answer::Unpin do
|
|||
it "unpins the answer" do
|
||||
expect { subject }.to change { answer.pinned_at }.from(pinned_at).to(nil)
|
||||
end
|
||||
|
||||
context "answer is already unpinned" do
|
||||
let(:pinned_at) { nil }
|
||||
|
||||
it "raises an error" do
|
||||
expect { subject }.to raise_error(Errors::BadRequest)
|
||||
expect(answer.reload.pinned_at).to eq(nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "as other user" do
|
||||
|
|
Loading…
Reference in a new issue