Merge tootsuite/master at 3023725936
This commit is contained in:
@@ -51,7 +51,9 @@ describe Api::V1::Accounts::CredentialsController do
|
||||
|
||||
describe 'with invalid data' do
|
||||
before do
|
||||
patch :update, params: { note: 'This is too long. ' * 10 }
|
||||
note = 'This is too long. '
|
||||
note = note + 'a' * (Account::MAX_NOTE_LENGTH - note.length + 1)
|
||||
patch :update, params: { note: note }
|
||||
end
|
||||
|
||||
it 'returns http unprocessable entity' do
|
||||
|
@@ -32,7 +32,7 @@ describe Api::V1::Accounts::RelationshipsController do
|
||||
json = body_as_json
|
||||
|
||||
expect(json).to be_a Enumerable
|
||||
expect(json.first[:following]).to be true
|
||||
expect(json.first[:following]).to be_truthy
|
||||
expect(json.first[:followed_by]).to be false
|
||||
end
|
||||
end
|
||||
@@ -51,7 +51,7 @@ describe Api::V1::Accounts::RelationshipsController do
|
||||
|
||||
expect(json).to be_a Enumerable
|
||||
expect(json.first[:id]).to eq simon.id.to_s
|
||||
expect(json.first[:following]).to be true
|
||||
expect(json.first[:following]).to be_truthy
|
||||
expect(json.first[:followed_by]).to be false
|
||||
expect(json.first[:muting]).to be false
|
||||
expect(json.first[:requested]).to be false
|
||||
|
@@ -31,10 +31,10 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
|
||||
it 'returns JSON with following=true and requested=false' do
|
||||
it 'returns JSON with following=truthy and requested=false' do
|
||||
json = body_as_json
|
||||
|
||||
expect(json[:following]).to be true
|
||||
expect(json[:following]).to be_truthy
|
||||
expect(json[:requested]).to be false
|
||||
end
|
||||
|
||||
@@ -50,11 +50,11 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
|
||||
it 'returns JSON with following=false and requested=true' do
|
||||
it 'returns JSON with following=false and requested=truthy' do
|
||||
json = body_as_json
|
||||
|
||||
expect(json[:following]).to be false
|
||||
expect(json[:requested]).to be true
|
||||
expect(json[:requested]).to be_truthy
|
||||
end
|
||||
|
||||
it 'creates a follow request relation between user and target user' do
|
||||
|
@@ -18,4 +18,24 @@ RSpec.describe Api::V1::MutesController, type: :controller do
|
||||
expect(response).to have_http_status(:success)
|
||||
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
|
||||
|
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Settings::KeywordMutesController, type: :controller do
|
||||
|
||||
end
|
Reference in New Issue
Block a user