Created
May 14, 2013 05:06
-
-
Save alexvbush/5573840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :post do | |
sequence(:post_title) {|n| "Post#{n}"} | |
post_date { Time.now - 10.days } | |
post_date_gmt { (Time.now - 10.days).gmtime } | |
post_modified { Time.now - 10.minutes } | |
post_modified_gmt { (Time.now - 10.minutes).gmtime } | |
post_status {"publish"} | |
factory :artist, :class => 'Artist' do | |
after(:create) do |post, evaluator| | |
create(:post_meta_artist, post: post) | |
end | |
end | |
factory :photo_album, :class => 'PhotoAlbum' do | |
after(:create) do |post, evaluator| | |
create(:post_meta_photo_album, post: post) | |
end | |
end | |
factory :photo do | |
after(:create) do |post, evaluator| | |
create(:post_meta_photo , post: post) | |
end | |
end | |
factory :playlist, :class => 'Playlist' do | |
after(:create) do |post, evaluator| | |
create(:post_meta_playlist, post: post) | |
end | |
end | |
factory :track, :class => 'Music' do | |
after(:create) do |post, evaluator| | |
create(:post_meta_track, post: post) | |
end | |
end | |
factory :mix, :class => 'Music' do | |
after(:create) do |post, evaluator| | |
create(:post_meta_mix, post: post) | |
end | |
end | |
factory :updates, :class => 'Updates' do | |
after(:create) do |post, e| | |
create(:post_meta_updates, post: post) | |
create(:post_meta_info, post: post) | |
end | |
end | |
end | |
factory :option, :class => 'Option' do | |
factory :option_stages do | |
#option_name {'stages_order'} | |
sequence(:option_name) { |n| "stages_order#{n}" } | |
#option_value {'["Stage1","Stage2","Stage3"]'} | |
sequence(:option_value) { |n| "'[\"Stage#{n + 1}\",\"Stage#{n + 2}\",\"Stage#{n + 3}\"]'" } | |
end | |
end | |
factory :post_meta do | |
factory :post_meta_artist do | |
meta_key 'type' | |
meta_value 'artist' | |
end | |
factory :post_meta_photo_album do | |
meta_key 'type' | |
meta_value 'photo_album' | |
end | |
factory :post_meta_updates do | |
meta_key 'type' | |
meta_value 'updates' | |
end | |
factory :post_meta_playlist do | |
meta_key 'type' | |
meta_value 'playlist' | |
end | |
factory :post_meta_track do | |
meta_key 'type' | |
meta_value 'track' | |
end | |
factory :post_meta_mix do | |
meta_key 'type' | |
meta_value 'mix' | |
end | |
factory :post_meta_info do | |
meta_key 'info' | |
meta_value 'updates_info' | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
# include ActionDispatch::TestProcess | |
factory :faq, :class => 'Faq' do | |
sequence(:post_title) {|n| "Post#{n}"} | |
post_date { Time.now - 10.days } | |
post_date_gmt { (Time.now - 10.days).gmtime } | |
post_modified { Time.now - 10.minutes } | |
post_modified_gmt { (Time.now - 10.minutes).gmtime } | |
post_status {"publish"} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :festival, :class => 'Festival' do | |
sequence(:name) { |n| "Festival Name #{n}" } | |
sequence(:description) { |n| "Festival Description #{n}" } | |
sequence(:location) { |n| "Festival Location #{n}" } | |
sequence(:city) { |n| "Festival City #{n}" } | |
sequence(:state) { |n| "Festival State #{n}" } | |
sequence(:map) { |n| "Festival Map #{n}" } | |
date Time.now | |
sequence(:website) { |n| "http://somewebsite#{n}.com" } | |
sequence(:facebook_page) { |n| "http://facebook.com/#{n}" } | |
sequence(:twitter_page) { |n| "http://twitter.com/#{n}" } | |
sequence(:tickets_page) { |n| "http://tickets_page.com/#{n}" } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'rspec/autorun' | |
require 'capybara/rspec' | |
require 'capybara/rails' | |
# Requires supporting ruby files with custom matchers and macros, etc, | |
# in spec/support/ and its subdirectories. | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
RSpec.configure do |config| | |
# ## Mock Framework | |
# | |
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: | |
# | |
# config.mock_with :mocha | |
# config.mock_with :flexmock | |
# config.mock_with :rr | |
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | |
# config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
# If you're not using ActiveRecord, or you'd prefer not to run each of your | |
# examples within a transaction, remove the following line or assign false | |
# instead of true. | |
config.use_transactional_fixtures = true | |
#config.use_instantiated_fixtures = false | |
# If true, the base class of anonymous controllers will be inferred | |
# automatically. This will be the default behavior in future versions of | |
# rspec-rails. | |
config.infer_base_class_for_anonymous_controllers = false | |
config.include FactoryGirl::Syntax::Methods | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment