|
106 | 106 | end |
107 | 107 |
|
108 | 108 | it 'should allow a non-blacklisted user to be created' do |
109 | | - user = User.new(email: 'foo@example.com', account: account, password: password) |
| 109 | + user = User.new(email: 'foo@example.com', account: account, password: password, agreement: true) |
110 | 110 |
|
111 | 111 | expect(user.valid?).to be_truthy |
112 | 112 | end |
113 | 113 |
|
114 | 114 | it 'should not allow a blacklisted user to be created' do |
115 | | - user = User.new(email: 'foo@mvrht.com', account: account, password: password) |
| 115 | + user = User.new(email: 'foo@mvrht.com', account: account, password: password, agreement: true) |
116 | 116 |
|
117 | 117 | expect(user.valid?).to be_falsey |
118 | 118 | end |
119 | 119 |
|
120 | 120 | it 'should not allow a subdomain blacklisted user to be created' do |
121 | | - user = User.new(email: 'foo@mvrht.com.topdomain.tld', account: account, password: password) |
| 121 | + user = User.new(email: 'foo@mvrht.com.topdomain.tld', account: account, password: password, agreement: true) |
122 | 122 |
|
123 | 123 | expect(user.valid?).to be_falsey |
124 | 124 | end |
|
210 | 210 | end |
211 | 211 |
|
212 | 212 | it 'should not allow a user to be created unless they are whitelisted' do |
213 | | - user = User.new(email: 'foo@example.com', account: account, password: password) |
| 213 | + user = User.new(email: 'foo@example.com', account: account, password: password, agreement: true) |
214 | 214 | expect(user.valid?).to be_falsey |
215 | 215 | end |
216 | 216 |
|
217 | 217 | it 'should allow a user to be created if they are whitelisted' do |
218 | | - user = User.new(email: 'foo@mastodon.space', account: account, password: password) |
| 218 | + user = User.new(email: 'foo@mastodon.space', account: account, password: password, agreement: true) |
219 | 219 | expect(user.valid?).to be_truthy |
220 | 220 | end |
221 | 221 |
|
222 | 222 | it 'should not allow a user with a whitelisted top domain as subdomain in their email address to be created' do |
223 | | - user = User.new(email: 'foo@mastodon.space.userdomain.com', account: account, password: password) |
| 223 | + user = User.new(email: 'foo@mastodon.space.userdomain.com', account: account, password: password, agreement: true) |
224 | 224 | expect(user.valid?).to be_falsey |
225 | 225 | end |
226 | 226 |
|
|
242 | 242 |
|
243 | 243 | it_behaves_like 'Settings-extended' do |
244 | 244 | def create! |
245 | | - User.create!(account: Fabricate(:account), email: 'foo@mastodon.space', password: 'abcd1234') |
| 245 | + User.create!(account: Fabricate(:account), email: 'foo@mastodon.space', password: 'abcd1234', agreement: true) |
246 | 246 | end |
247 | 247 |
|
248 | 248 | def fabricate |
|
0 commit comments