diff options
author | ThibG <thib@sitedethib.com> | 2018-08-17 18:09:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 18:09:30 +0200 |
commit | 32075fe27f699d5a586e6ecf26c172550f9d4086 (patch) | |
tree | 61f48fa2dee608f72990f76a8f0497d670339252 /spec/models | |
parent | 4a6bc2482a26aa0441485ca360a3d3c0eeea7fe4 (diff) | |
parent | a16ff45d81d77d93f33ad57e746c780392ab1a1c (diff) |
Merge pull request #642 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/export_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/follow_spec.rb | 16 | ||||
-rw-r--r-- | spec/models/status_stat_spec.rb | 5 |
3 files changed, 24 insertions, 3 deletions
diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index 6daa46145..277dcc526 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -48,17 +48,17 @@ describe Export do describe 'total_follows' do it 'returns the total number of the followed accounts' do target_accounts.each(&account.method(:follow!)) - expect(Export.new(account).total_follows).to eq 2 + expect(Export.new(account.reload).total_follows).to eq 2 end it 'returns the total number of the blocked accounts' do target_accounts.each(&account.method(:block!)) - expect(Export.new(account).total_blocks).to eq 2 + expect(Export.new(account.reload).total_blocks).to eq 2 end it 'returns the total number of the muted accounts' do target_accounts.each(&account.method(:mute!)) - expect(Export.new(account).total_mutes).to eq 2 + expect(Export.new(account.reload).total_mutes).to eq 2 end end end diff --git a/spec/models/follow_spec.rb b/spec/models/follow_spec.rb index 43175d852..f221973b6 100644 --- a/spec/models/follow_spec.rb +++ b/spec/models/follow_spec.rb @@ -37,4 +37,20 @@ RSpec.describe Follow, type: :model do expect(a[1]).to eq follow0 end end + + describe 'revoke_request!' do + let(:follow) { Fabricate(:follow, account: account, target_account: target_account) } + let(:account) { Fabricate(:account) } + let(:target_account) { Fabricate(:account) } + + it 'revokes the follow relation' do + follow.revoke_request! + expect(account.following?(target_account)).to be false + end + + it 'creates a follow request' do + follow.revoke_request! + expect(account.requested?(target_account)).to be true + end + end end diff --git a/spec/models/status_stat_spec.rb b/spec/models/status_stat_spec.rb new file mode 100644 index 000000000..5e9351aff --- /dev/null +++ b/spec/models/status_stat_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe StatusStat, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end |