3737module SpecHelpers
3838 class << self
3939 def setup_data
40- Rails . application . load_seed
41- author = Author . find_by! ( name : 'A test author' )
42- tag = Tag . find_by! ( name : 'A test tag' )
43- Post . first . update! ( title : 'A post' , author : author , category : 'news' , published : true , dt : Time . zone . today )
44- Post . second . update! ( title : 'Another post' , author : author , category : 'story' , dt : Date . yesterday , tags : [ tag ] )
45- Post . third . update! ( title : 'Last post' , author : author , category : 'news' , position : 234 , dt : Date . tomorrow )
40+ author1 = Author . create! ( name :
'First author' , email :
'[email protected] ' , age :
33 ) 41+ author2 = Author . create! ( name :
'Second author' , email :
'[email protected] ' , age :
42 ) 42+ tag = Tag . create! ( name : 'A test tag' )
43+ Post . create! ( title : 'A post' , author : author1 , category : 'news' , published : true , dt : Time . zone . today )
44+ Post . create! ( title : 'Another post' , author : author1 , category : 'story' , dt : Date . yesterday , tags : [ tag ] )
45+ Post . create! ( title : 'Last post' , author : author1 , category : 'news' , position : 234 , dt : Date . tomorrow )
46+ Post . create! ( title : 'More post' , author : author2 , category : 'gallery' , dt : Date . yesterday )
4647 end
4748 end
4849end
@@ -61,10 +62,6 @@ def setup_data
6162 config . use_instantiated_fixtures = false
6263 config . render_views = false
6364
64- config . before ( :suite ) do
65- SpecHelpers . setup_data
66- end
67-
6865 config . before ( :suite ) do
6966 require 'administrate/version'
7067
0 commit comments