mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-12 21:00:58 +00:00
Spec tidying
This commit is contained in:
parent
b55ff01ff5
commit
dd899cddb0
10 changed files with 35 additions and 35 deletions
2
spec/factories/article.rb
Normal file → Executable file
2
spec/factories/article.rb
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
|||
FactoryGirl.define do
|
||||
factory :article do
|
||||
sequence(:title) { |n| "Article #{n}" }
|
||||
sequence(:text) { |n| (0..100).map{ (0...8).map { (65 + rand(26)).chr }.join }.join(" ") }
|
||||
sequence(:text) { (0..100).map { (0...8).map { (65 + rand(26)).chr }.join }.join(" ") }
|
||||
end
|
||||
end
|
2
spec/factories/ban.rb
Normal file → Executable file
2
spec/factories/ban.rb
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
|||
FactoryGirl.define do
|
||||
factory :ban do
|
||||
ban_type Ban::TYPE_SITE
|
||||
expiry Date.today + 1
|
||||
expiry Time.now.utc.to_date + 1
|
||||
# Hack because of the awkward way bans are created (requires user_name)
|
||||
before(:create) do |ban|
|
||||
if ban.user.nil?
|
||||
|
|
0
spec/factories/category.rb
Normal file → Executable file
0
spec/factories/category.rb
Normal file → Executable file
0
spec/factories/gather.rb
Normal file → Executable file
0
spec/factories/gather.rb
Normal file → Executable file
0
spec/factories/grouper.rb
Normal file → Executable file
0
spec/factories/grouper.rb
Normal file → Executable file
0
spec/factories/issue.rb
Normal file → Executable file
0
spec/factories/issue.rb
Normal file → Executable file
0
spec/factories/message.rb
Normal file → Executable file
0
spec/factories/message.rb
Normal file → Executable file
0
spec/factories/server.rb
Normal file → Executable file
0
spec/factories/server.rb
Normal file → Executable file
0
spec/factories/team.rb
Normal file → Executable file
0
spec/factories/team.rb
Normal file → Executable file
6
spec/models/user_spec.rb
Normal file → Executable file
6
spec/models/user_spec.rb
Normal file → Executable file
|
@ -22,7 +22,7 @@
|
|||
# salt :string(255)
|
||||
#
|
||||
|
||||
require 'spec_helper'
|
||||
require "spec_helper"
|
||||
|
||||
describe User do
|
||||
let!(:user) { create :user }
|
||||
|
@ -34,7 +34,7 @@ describe User do
|
|||
|
||||
it "returns true if user is banned" do
|
||||
Ban.create!(ban_type: Ban::TYPE_SITE,
|
||||
expiry: Time.now + 10.days,
|
||||
expiry: Time.now.utc + 10.days,
|
||||
user_name: user.username)
|
||||
|
||||
expect(user.banned?).to be_truthy
|
||||
|
@ -42,7 +42,7 @@ describe User do
|
|||
|
||||
it "returns true for specific bans" do
|
||||
Ban.create!(ban_type: Ban::TYPE_MUTE,
|
||||
expiry: Time.now + 10.days,
|
||||
expiry: Time.now.utc + 10.days,
|
||||
user_name: user.username)
|
||||
|
||||
expect(user.banned? Ban::TYPE_MUTE).to be_truthy
|
||||
|
|
Loading…
Reference in a new issue