diff options
author | re4k <re4k@re4k.info> | 2013-04-23 22:20:39 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-04-23 22:20:39 +0900 |
commit | 17f9b3cf660086427b7089ba2f1ba5b2adc738be (patch) | |
tree | fe29e4506a0e7f78e09d29814c17bf8de810df17 /spec/factories | |
parent | 667d88c12805d2a1f5b62b9ff4e04d6e9ba595fe (diff) | |
download | aclog-17f9b3cf660086427b7089ba2f1ba5b2adc738be.tar.gz |
rewrite Tweet tests/fixtures
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/favorites.rb | 2 | ||||
-rw-r--r-- | spec/factories/retweets.rb | 2 | ||||
-rw-r--r-- | spec/factories/tweets.rb | 6 | ||||
-rw-r--r-- | spec/factories/users.rb | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/spec/factories/favorites.rb b/spec/factories/favorites.rb index 4b9551d..56a794e 100644 --- a/spec/factories/favorites.rb +++ b/spec/factories/favorites.rb @@ -1,6 +1,4 @@ FactoryGirl.define do factory :favorite do - user - tweet end end diff --git a/spec/factories/retweets.rb b/spec/factories/retweets.rb index 9f9dba6..67bb1b0 100644 --- a/spec/factories/retweets.rb +++ b/spec/factories/retweets.rb @@ -1,6 +1,4 @@ FactoryGirl.define do factory :retweet do - user - tweet end end diff --git a/spec/factories/tweets.rb b/spec/factories/tweets.rb index 01f7919..9b4250c 100644 --- a/spec/factories/tweets.rb +++ b/spec/factories/tweets.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :tweet do |t| - sequence(:text){|n| "text_" + (n ** 2).to_s} - sequence(:source){|n| "source_" + (n % 10).to_s} - sequence(:tweeted_at){|n| Time.at((1199113200..1388502000).to_a.sample)} + sequence(:text){|n| "text_#{n}"} + sequence(:source){|n| "source_#{n / 2}"} + sequence(:tweeted_at){|n| Time.at(1360000000 + n * 1000)} end end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 35270ad..87159e0 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -8,6 +8,7 @@ FactoryGirl.define do protected false end + # screen_name won't be changed factory :user_exists, class: User do id 15926668 screen_name "toshi_a" @@ -16,6 +17,7 @@ FactoryGirl.define do protected false end + # nil factory :user_not_exists, class: User do id 0 screen_name "" @@ -24,6 +26,7 @@ FactoryGirl.define do protected false end + # permanent suspended factory :user_suspended, class: User do id 230367516 screen_name "re4k" @@ -32,6 +35,7 @@ FactoryGirl.define do protected false end + # model user factory :user do |u| sequence(:screen_name){|n| "screen_name_#{n}"} sequence(:name){|n| "name_#{n}"} |