Code style changes in specs and removed an extra space
This commit is contained in:
parent
22cf9bcff6
commit
8c6ecd5616
|
@ -82,7 +82,7 @@ export default class Account extends ImmutablePureComponent {
|
|||
} else if (muting) {
|
||||
let hidingNotificationsButton;
|
||||
if (muting.get('notifications')) {
|
||||
hidingNotificationsButton = <IconButton active icon='bell' title={intl.formatMessage(messages.unmute_notifications, { name: account.get('username') })} onClick={this.handleUnmuteNotifications} />;
|
||||
hidingNotificationsButton = <IconButton active icon='bell' title={intl.formatMessage(messages.unmute_notifications, { name: account.get('username') })} onClick={this.handleUnmuteNotifications} />;
|
||||
} else {
|
||||
hidingNotificationsButton = <IconButton active icon='bell-slash' title={intl.formatMessage(messages.mute_notifications, { name: account.get('username') })} onClick={this.handleMuteNotifications} />;
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ RSpec.describe Api::V2::MutesController, type: :controller do
|
|||
end
|
||||
|
||||
it 'returns one mute' do
|
||||
expect(mutes.size).to be(1)
|
||||
expect(mutes.size).to be 1
|
||||
end
|
||||
|
||||
it 'returns whether the mute hides notifications' do
|
||||
expect(mutes.first["hide_notifications"]).to be(false)
|
||||
expect(mutes.first["hide_notifications"]).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,38 +2,37 @@ require 'rails_helper'
|
|||
|
||||
describe AccountInteractions do
|
||||
describe 'muting an account' do
|
||||
before do
|
||||
@me = Fabricate(:account, username: 'Me')
|
||||
@you = Fabricate(:account, username: 'You')
|
||||
let(:me) { Fabricate(:account, username: 'Me') }
|
||||
let(:you) { Fabricate(:account, username: 'You') }
|
||||
end
|
||||
|
||||
context 'with the notifications option unspecified' do
|
||||
before do
|
||||
@me.mute!(@you)
|
||||
me.mute!(you)
|
||||
end
|
||||
|
||||
it 'defaults to muting notifications' do
|
||||
expect(@me.muting_notifications?(@you)).to be(true)
|
||||
expect(me.muting_notifications?(you)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
context 'with the notifications option set to false' do
|
||||
before do
|
||||
@me.mute!(@you, notifications: false)
|
||||
me.mute!(you, notifications: false)
|
||||
end
|
||||
|
||||
it 'does not mute notifications' do
|
||||
expect(@me.muting_notifications?(@you)).to be(false)
|
||||
expect(me.muting_notifications?(you)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'with the notifications option set to true' do
|
||||
before do
|
||||
@me.mute!(@you, notifications: true)
|
||||
me.mute!(you, notifications: true)
|
||||
end
|
||||
|
||||
it 'does mute notifications' do
|
||||
expect(@me.muting_notifications?(@you)).to be(true)
|
||||
expect(me.muting_notifications?(you)).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Reference in a new issue