mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:42:53 +08:00
Fix build.
This commit is contained in:
parent
e336e56153
commit
ffbfcd7ee2
|
@ -105,7 +105,7 @@ describe PostsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "resets the votes" do
|
it "resets the votes" do
|
||||||
DiscoursePoll::Poll.vote(post_id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user.id)
|
DiscoursePoll::Poll.vote(post_id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user)
|
||||||
xhr :put, :update, { id: post_id, post: { raw: "[poll]\n- A\n- B\n- C\n[/poll]" } }
|
xhr :put, :update, { id: post_id, post: { raw: "[poll]\n- A\n- B\n- C\n[/poll]" } }
|
||||||
expect(response).to be_success
|
expect(response).to be_success
|
||||||
json = ::JSON.parse(response.body)
|
json = ::JSON.parse(response.body)
|
||||||
|
@ -156,7 +156,7 @@ describe PostsController do
|
||||||
describe "with at least one vote" do
|
describe "with at least one vote" do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
DiscoursePoll::Poll.vote(post_id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user.id)
|
DiscoursePoll::Poll.vote(post_id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "OP cannot change the options" do
|
it "OP cannot change the options" do
|
||||||
|
|
|
@ -130,12 +130,12 @@ describe DiscoursePoll::PollsUpdater do
|
||||||
let(:user) { Fabricate(:user) }
|
let(:user) { Fabricate(:user) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
DiscoursePoll::Poll.vote(post.id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user.id)
|
DiscoursePoll::Poll.vote(post.id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user)
|
||||||
post.reload
|
post.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not allow a private poll with votes to be made public" do
|
it "should not allow a private poll with votes to be made public" do
|
||||||
DiscoursePoll::Poll.vote(private_poll_post.id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user.id)
|
DiscoursePoll::Poll.vote(private_poll_post.id, "poll", ["5c24fc1df56d764b550ceae1b9319125"], user)
|
||||||
private_poll_post.reload
|
private_poll_post.reload
|
||||||
|
|
||||||
messages = MessageBus.track_publish do
|
messages = MessageBus.track_publish do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user