-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch.diff
118 lines (96 loc) · 3.85 KB
/
patch.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb
index fe40ee6..122de41 100644
--- a/spec/controllers/statuses_controller_spec.rb
+++ b/spec/controllers/statuses_controller_spec.rb
@@ -2,13 +2,12 @@
require 'rails_helper'
-describe StatusesController do
+describe StatusesController, :account do
render_views
- describe 'GET #show' do
- let(:account) { Fabricate(:account) }
- let(:status) { Fabricate(:status, account: account) }
+ let_it_be(:status) { Fabricate(:status, account: account) }
+ describe 'GET #show' do
context 'when account is permanently suspended' do
before do
account.suspend!
@@ -89,7 +88,7 @@ describe StatusesController do
end
context 'when status is private' do
- let(:status) { Fabricate(:status, account: account, visibility: :private) }
+ before { status.update!(visibility: :private) }
before do
get :show, params: { account_username: status.account.username, id: status.id, format: format }
@@ -113,7 +112,7 @@ describe StatusesController do
end
context 'when status is direct' do
- let(:status) { Fabricate(:status, account: account, visibility: :direct) }
+ before { status.update!(visibility: :direct) }
before do
get :show, params: { account_username: status.account.username, id: status.id, format: format }
@@ -136,9 +135,7 @@ describe StatusesController do
end
end
- context 'when signed-in' do
- let(:user) { Fabricate(:user) }
-
+ context 'when signed-in', :user do
before do
sign_in(user)
end
@@ -194,7 +191,7 @@ describe StatusesController do
end
context 'when status is private' do
- let(:status) { Fabricate(:status, account: account, visibility: :private) }
+ before { status.update!(visibility: :private) }
context 'when user is authorized to see it' do
before do
@@ -261,7 +258,7 @@ describe StatusesController do
end
context 'when status is direct' do
- let(:status) { Fabricate(:status, account: account, visibility: :direct) }
+ before { status.update!(visibility: :direct) }
context 'when user is authorized to see it' do
before do
@@ -328,7 +325,7 @@ describe StatusesController do
end
context 'with signature' do
- let(:remote_account) { Fabricate(:account, domain: 'example.com') }
+ let_it_be(:remote_account) { Fabricate(:account, domain: 'example.com') }
before do
allow(controller).to receive(:signed_request_actor).and_return(remote_account)
@@ -397,7 +394,7 @@ describe StatusesController do
end
context 'when status is private' do
- let(:status) { Fabricate(:status, account: account, visibility: :private) }
+ before { status.update!(visibility: :private) }
context 'when user is authorized to see it' do
before do
@@ -464,7 +461,7 @@ describe StatusesController do
end
context 'when status is direct' do
- let(:status) { Fabricate(:status, account: account, visibility: :direct) }
+ before { status.update!(visibility: :direct) }
context 'when user is authorized to see it' do
before do
@@ -531,9 +528,8 @@ describe StatusesController do
end
end
- describe 'GET #activity' do
- let(:account) { Fabricate(:account) }
- let(:status) { Fabricate(:status, account: account) }
+ describe 'GET #activity', :account do
+ let_it_be(:status) { Fabricate(:status, account: account) }
context 'when account is permanently suspended' do
before do
@@ -593,9 +589,7 @@ describe StatusesController do
end
end
- context 'when signed-in' do
- let(:user) { Fabricate(:user) }
-
+ context 'when signed-in', :user do
before do
sign_in(user)
end