Sha256: 4a1e9e603c234f1b773f1fa690407113a01f165e41942a9316af19ada73f6b33

Contents?: true

Size: 931 Bytes

Versions: 19

Compression:

Stored size: 931 Bytes

Contents

# you can delete this file if you don't use Rails Test Fixtures

fixtures_dir = command_options.try(:[], 'fixtures_dir')
fixture_files = command_options.try(:[], 'fixtures')

if defined?(ActiveRecord)
  require "active_record/fixtures"

  fixtures_dir ||= ActiveRecord::Tasks::DatabaseTasks.fixtures_path
  fixture_files ||= Dir["#{fixtures_dir}/**/*.yml"].map { |f| f[(fixtures_dir.size + 1)..-5] }

  logger.debug "loading fixtures: { dir: #{fixtures_dir}, files: #{fixture_files} }"
  ActiveRecord::FixtureSet.reset_cache
  ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files)
  "Fixtures Done" # this gets returned
else # this else part can be removed
  logger.error "Looks like activerecord_fixtures has to be modified to suite your need"
  Post.create(title: 'MyCypressFixtures')
  Post.create(title: 'MyCypressFixtures2')
  Post.create(title: 'MyRailsFixtures')
  Post.create(title: 'MyRailsFixtures2')
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cypress-on-rails-1.17.0 lib/generators/cypress_on_rails/templates/spec/e2e/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.16.0 lib/generators/cypress_on_rails/templates/spec/e2e/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.15.1 lib/generators/cypress_on_rails/templates/spec/e2e/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.15.0 lib/generators/cypress_on_rails/templates/spec/e2e/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.14.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.13.1 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.13.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.12.1 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.12.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.11.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.10.1 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.9.1 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.9.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.8.1 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.8.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.7.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.6.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.5.1 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
cypress-on-rails-1.5.0 lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb