fix tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory(:artist_url) do
|
||||
artist
|
||||
url {Faker::Internet.domain_name}
|
||||
url {FFaker::Internet.domain_name}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory(:ban) do |f|
|
||||
reason {Faker::Lorem.words.join(" ")}
|
||||
reason {FFaker::Lorem.words.join(" ")}
|
||||
duration 60
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory(:comment) do |f|
|
||||
post
|
||||
body {Faker::Lorem.sentences.join(" ")}
|
||||
body {FFaker::Lorem.sentences.join(" ")}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FactoryGirl.define do
|
||||
factory(:dmail) do
|
||||
to :factory => :user
|
||||
title {Faker::Lorem.words.join(" ")}
|
||||
body {Faker::Lorem.sentences.join(" ")}
|
||||
title {FFaker::Lorem.words.join(" ")}
|
||||
body {FFaker::Lorem.sentences.join(" ")}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FactoryGirl.define do
|
||||
factory(:forum_post) do
|
||||
body {Faker::Lorem.sentences.join(" ")}
|
||||
body {FFaker::Lorem.sentences.join(" ")}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory(:forum_topic) do
|
||||
title {Faker::Lorem.words.join(" ")}
|
||||
title {FFaker::Lorem.words.join(" ")}
|
||||
is_sticky false
|
||||
is_locked false
|
||||
category_id 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FactoryGirl.define do
|
||||
factory(:ip_ban) do
|
||||
creator :factory => :user
|
||||
reason {Faker::Lorem.words.join(" ")}
|
||||
reason {FFaker::Lorem.words.join(" ")}
|
||||
ip_addr "127.0.0.1"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ FactoryGirl.define do
|
||||
width 1
|
||||
height 1
|
||||
is_active true
|
||||
body {Faker::Lorem.sentences.join(" ")}
|
||||
body {FFaker::Lorem.sentences.join(" ")}
|
||||
updater_id :factory => :user
|
||||
updater_ip_addr "127.0.0.1"
|
||||
end
|
||||
|
||||
@@ -2,6 +2,6 @@ FactoryGirl.define do
|
||||
factory(:pool) do
|
||||
name {(rand(1_000_000) + 100).to_s}
|
||||
association :creator, :factory => :user
|
||||
description {Faker::Lorem.sentences.join(" ")}
|
||||
description {FFaker::Lorem.sentences.join(" ")}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
FactoryGirl.define do
|
||||
factory(:post) do
|
||||
md5 {|x| Time.now.to_f.to_s}
|
||||
sequence :md5 do |n|
|
||||
n.to_s
|
||||
end
|
||||
uploader :factory => :user
|
||||
uploader_ip_addr "127.0.0.1"
|
||||
tag_string "tag1 tag2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory(:tag) do
|
||||
name {"#{Faker::Name.first_name.downcase}#{rand(1000)}"}
|
||||
name {"#{FFaker::Name.first_name.downcase}#{rand(1000)}"}
|
||||
post_count 0
|
||||
category {Tag.categories.general}
|
||||
related_tags ""
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory(:tag_subscription) do
|
||||
name {Faker::Lorem.words.join(" ")}
|
||||
name {FFaker::Lorem.words.join(" ")}
|
||||
is_public true
|
||||
tag_query "aaa"
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ FactoryGirl.define do
|
||||
name {(rand(1_000_000) + 10).to_s}
|
||||
password "password"
|
||||
password_hash {User.sha1("password")}
|
||||
email {Faker::Internet.email}
|
||||
email {FFaker::Internet.email}
|
||||
default_image_size "large"
|
||||
base_upload_limit 10
|
||||
level 20
|
||||
|
||||
@@ -2,6 +2,6 @@ FactoryGirl.define do
|
||||
factory(:user_feedback) do
|
||||
user
|
||||
category "positive"
|
||||
body {Faker::Lorem.words.join(" ")}
|
||||
body {FFaker::Lorem.words.join(" ")}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
FactoryGirl.define do
|
||||
factory(:wiki_page) do
|
||||
creator :factory => :user
|
||||
title {Faker::Lorem.words.join(" ")}
|
||||
body {Faker::Lorem.sentences.join(" ")}
|
||||
title {FFaker::Lorem.words.join(" ")}
|
||||
body {FFaker::Lorem.sentences.join(" ")}
|
||||
end
|
||||
end
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -21,12 +21,12 @@ class DmailFilterTest < ActiveSupport::TestCase
|
||||
|
||||
should "filter on that word in the body" do
|
||||
create_dmail("banned", "okay")
|
||||
assert_equal(true, @receiver.dmails.last.is_deleted?)
|
||||
assert_equal(true, @receiver.dmails.last.is_read?)
|
||||
end
|
||||
|
||||
should "filter on that word in the title" do
|
||||
create_dmail("okay", "banned")
|
||||
assert_equal(true, @receiver.dmails.last.is_deleted?)
|
||||
assert_equal(true, @receiver.dmails.last.is_read?)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ class DmailFilterTest < ActiveSupport::TestCase
|
||||
|
||||
should "filter on the sender" do
|
||||
create_dmail("okay", "okay")
|
||||
assert_equal(true, @receiver.dmails.last.is_deleted?)
|
||||
assert_equal(true, @receiver.dmails.last.is_read?)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,8 +8,8 @@ module Maintenance
|
||||
@user = FactoryGirl.create(:user)
|
||||
end
|
||||
|
||||
should "send the notie" do
|
||||
LoginReminderMailer.notice(@user).deliver
|
||||
should "send the notice" do
|
||||
LoginReminderMailer.notice(@user).deliver_now
|
||||
assert !ActionMailer::Base.deliveries.empty?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -463,8 +463,8 @@ class PostTest < ActiveSupport::TestCase
|
||||
|
||||
context "as a new user" do
|
||||
setup do
|
||||
CurrentUser.user = FactoryGirl.create(:user)
|
||||
@post.update_attribute(:tag_string, "aaa bbb ccc ddd")
|
||||
CurrentUser.user = FactoryGirl.create(:user)
|
||||
end
|
||||
|
||||
should "not allow you to remove more than 2 tags" do
|
||||
|
||||
@@ -31,8 +31,8 @@ module Sources
|
||||
end
|
||||
|
||||
should "get the image url" do
|
||||
assert_equal("http://lohas.nicoseiga.jp/priv/2da967039fd50a09c634dba26c1162ecf1c35ef7/1436234417/4937663", @site_1.image_url)
|
||||
assert_equal("http://lohas.nicoseiga.jp/priv/ee9cb45867d86771abf4ba90c74de07bdc4c7e1a/1436234419/4937663", @site_2.image_url)
|
||||
assert_equal("http://lohas.nicoseiga.jp/priv/3a50d7fe7e55e57937e08eeadccb69611d8485bf/1439946517/4937663", @site_1.image_url)
|
||||
assert_equal("http://lohas.nicoseiga.jp/priv/2bd59bd4b014227d23aa78488ddec8d414c1bd38/1439946519/4937663", @site_2.image_url)
|
||||
end
|
||||
|
||||
should "get the tags" do
|
||||
|
||||
Reference in New Issue
Block a user