mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-15 07:34:58 +01:00
c816701550
Conflicts: .travis.yml Gemfile.lock README.md app/controllers/settings/follower_domains_controller.rb app/controllers/statuses_controller.rb app/javascript/mastodon/locales/ja.json app/lib/feed_manager.rb app/models/media_attachment.rb app/models/mute.rb app/models/status.rb app/services/mute_service.rb app/views/home/index.html.haml app/views/stream_entries/_simple_status.html.haml config/locales/ca.yml config/locales/en.yml config/locales/es.yml config/locales/fr.yml config/locales/nl.yml config/locales/pl.yml config/locales/pt-BR.yml config/themes.yml
42 lines
1.0 KiB
Ruby
42 lines
1.0 KiB
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Api::V1::MutesController, type: :controller do
|
|
render_views
|
|
|
|
let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
|
|
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') }
|
|
|
|
before do
|
|
Fabricate(:mute, account: user.account, hide_notifications: false)
|
|
allow(controller).to receive(:doorkeeper_token) { token }
|
|
end
|
|
|
|
describe 'GET #index' do
|
|
it 'returns http success' do
|
|
get :index, params: { limit: 1 }
|
|
|
|
expect(response).to have_http_status(200)
|
|
end
|
|
end
|
|
|
|
describe 'GET #details' do
|
|
before do
|
|
get :details, params: { limit: 1 }
|
|
end
|
|
|
|
let(:mutes) { JSON.parse(response.body) }
|
|
|
|
it 'returns http success' do
|
|
expect(response).to have_http_status(:success)
|
|
end
|
|
|
|
it 'returns one mute' do
|
|
expect(mutes.size).to be(1)
|
|
end
|
|
|
|
it 'returns whether the mute hides notifications' do
|
|
expect(mutes.first["hide_notifications"]).to be(false)
|
|
end
|
|
end
|
|
end
|