diff --git a/spec/factories/article.rb b/spec/factories/article.rb old mode 100644 new mode 100755 index 8e03ad7..b937dac --- a/spec/factories/article.rb +++ b/spec/factories/article.rb @@ -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 \ No newline at end of file +end diff --git a/spec/factories/ban.rb b/spec/factories/ban.rb old mode 100644 new mode 100755 index 0f998be..d477915 --- a/spec/factories/ban.rb +++ b/spec/factories/ban.rb @@ -1,13 +1,13 @@ 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? user = create :user ban.user_name = user.username - else + else ban.user_name = ban.user.username end end @@ -28,4 +28,4 @@ FactoryGirl.define do trait :expired do expiry Date.yesterday - 1 end -end \ No newline at end of file +end diff --git a/spec/factories/category.rb b/spec/factories/category.rb old mode 100644 new mode 100755 index 14dd5ef..f94392d --- a/spec/factories/category.rb +++ b/spec/factories/category.rb @@ -5,10 +5,10 @@ FactoryGirl.define do end trait :news do - domain Category::DOMAIN_NEWS + domain Category::DOMAIN_NEWS end trait :game do - domain Category::DOMAIN_GAMES + domain Category::DOMAIN_GAMES end -end \ No newline at end of file +end diff --git a/spec/factories/gather.rb b/spec/factories/gather.rb old mode 100644 new mode 100755 index a7b1d0a..0316a7b --- a/spec/factories/gather.rb +++ b/spec/factories/gather.rb @@ -4,10 +4,10 @@ FactoryGirl.define do end trait :running do - status Gather::STATE_RUNNING + status Gather::STATE_RUNNING end trait :picking do - status Gather::STATE_PICKING + status Gather::STATE_PICKING end end diff --git a/spec/factories/grouper.rb b/spec/factories/grouper.rb old mode 100644 new mode 100755 index 54c492b..3e172bb --- a/spec/factories/grouper.rb +++ b/spec/factories/grouper.rb @@ -1,5 +1,5 @@ FactoryGirl.define do - factory :grouper do - sequence(:task) { |n| "Task#{n}" } - end -end \ No newline at end of file + factory :grouper do + sequence(:task) { |n| "Task#{n}" } + end +end diff --git a/spec/factories/issue.rb b/spec/factories/issue.rb old mode 100644 new mode 100755 index f7a9d4d..3f51961 --- a/spec/factories/issue.rb +++ b/spec/factories/issue.rb @@ -1,8 +1,8 @@ FactoryGirl.define do - factory :issue do - sequence(:title) { |n| "Issue title #{n}" } - sequence(:text) { |n| "Issue Text #{n}" } - status Issue::STATUS_OPEN - association :author, factory: :user - end -end \ No newline at end of file + factory :issue do + sequence(:title) { |n| "Issue title #{n}" } + sequence(:text) { |n| "Issue Text #{n}" } + status Issue::STATUS_OPEN + association :author, factory: :user + end +end diff --git a/spec/factories/message.rb b/spec/factories/message.rb old mode 100644 new mode 100755 index 1f44662..bb88f6f --- a/spec/factories/message.rb +++ b/spec/factories/message.rb @@ -1,9 +1,9 @@ FactoryGirl.define do - factory :message do - association :sender, factory: :user - association :recipient, factory: :user - sequence(:text) { |n| "text-#{n}" } - sequence(:title) { |n| "title-#{n}" } - sequence(:text_parsed) { |n| "text-#{n}" } - end -end \ No newline at end of file + factory :message do + association :sender, factory: :user + association :recipient, factory: :user + sequence(:text) { |n| "text-#{n}" } + sequence(:title) { |n| "title-#{n}" } + sequence(:text_parsed) { |n| "text-#{n}" } + end +end diff --git a/spec/factories/server.rb b/spec/factories/server.rb old mode 100644 new mode 100755 index e5cb877..81440a7 --- a/spec/factories/server.rb +++ b/spec/factories/server.rb @@ -13,4 +13,4 @@ FactoryGirl.define do active false end end -end \ No newline at end of file +end diff --git a/spec/factories/team.rb b/spec/factories/team.rb old mode 100644 new mode 100755 index 1a3902b..7a23a48 --- a/spec/factories/team.rb +++ b/spec/factories/team.rb @@ -1,11 +1,11 @@ FactoryGirl.define do factory :team do sequence(:name) { |n| "Team ##{n}" } - + irc "#team" web "http://team.com" tag "[TEAM]" country "EU" comment "We are a team" end -end \ No newline at end of file +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb old mode 100644 new mode 100755 index 0258344..b67632e --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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