docbrown/spec/requests/users_api_spec.rb
Mac Siri 6d1638ed68 Unskip all skipped specs (#2941)
* Change all login_as to sign_in

* Unskip comment spec

* Create new specs

* Turn on Webdriver caching

* Set logger for Omniauth in test

* Update editor system spec

* Fix editor approval file

* Update video_controller

* Update TagAdjustmentUpdateService's spec

* Update users api spec

* Update stories_index_spec

* Remove redundant spec file

* Remove residual code

* Change ClassifiedListing spec

* Update NotificationsIndex spec
2019-05-25 11:04:38 -04:00

26 lines
629 B
Ruby

require "rails_helper"
RSpec.describe "Api::V0::Users", type: :request do
let(:user) { create(:user) }
let(:tag) { create(:tag) }
describe "GET /api/users" do
it "returns user objects" do
user.follow(tag)
other_user = create(:user)
create(:article, user: other_user, tags: [tag.name])
sign_in user
get "/api/users?state=follow_suggestions"
expect(response.body).to include(other_user.name)
end
end
describe "GET /api/users/:id" do
it "returns user show object" do
get "/api/users/#{user.id}"
expect(response.body).to include(user.name)
end
end
end