discourse/plugins/poll/spec/integration/poll_endpoints_spec.rb

19 lines
449 B
Ruby
Raw Normal View History

2016-06-09 09:33:17 -04:00
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