File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 117
117
state { User ::ACTIVE }
118
118
end
119
119
120
- Fabricator ( :pending_user , from : 'User' ) do
121
- github { 'bguthrie' }
122
- username { FFaker ::Internet . user_name . gsub ( /\. / , '_' ) }
123
- name { 'Brian Guthrie' }
124
- email { 'someone@example.com' }
125
- location { 'Mountain View' }
126
- github_token { FFaker ::Internet . ip_v4_address }
120
+ Fabricator ( :pending_user , from : :user ) do
127
121
state { User ::PENDING }
128
122
end
123
+
124
+ Fabricator ( :admin , from : :user ) do
125
+ email { FFaker ::Internet . email ( 'admin' ) }
126
+ role 'admin'
127
+ end
Original file line number Diff line number Diff line change 3
3
4
4
let ( :mail ) { AbuseMailer . report_inappropriate ( protip . to_param ) }
5
5
6
- let! ( :current_user ) { Fabricate ( :user , admin : true ) }
6
+ let! ( :current_user ) { Fabricate ( :admin ) }
7
7
8
8
let ( :protip ) do
9
9
Protip . create! (
16
16
17
17
it 'renders the headers' do
18
18
expect ( mail . subject ) . to match ( 'Spam Report for Protip: "hello world"' )
19
- expect ( mail . to ) . to eq ( [ 'someone@example.com' ] )
19
+ expect ( mail . to ) . to eq ( [ current_user . email ] )
20
20
expect ( mail . from ) . to eq ( [ 'support@coderwall.com' ] )
21
21
end
22
22
You can’t perform that action at this time.
0 commit comments