mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-21 21:12:39 -05:00
18 lines
449 B
Ruby
18 lines
449 B
Ruby
require "rails_helper"
|
|
|
|
describe "DiscoursePoll endpoints" do
|
|
describe "fetch voters from user_ids" do
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
it "should return the right response" do
|
|
get "/polls/voters.json", { user_ids: [user.id] }
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
json = JSON.parse(response.body)["users"].first
|
|
|
|
expect(json["name"]).to eq(user.name)
|
|
expect(json["title"]).to eq(user.title)
|
|
end
|
|
end
|
|
end
|