repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/controller/controller_generator_spec.rb | spec/generators/rspec/controller/controller_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/controller/controller_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::ControllerGenerator, type: :generator do
setup_default_destination
describe 'request specs' do
subject(:filename) { file('spec/requests/p... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/system/system_generator_spec.rb | spec/generators/rspec/system/system_generator_spec.rb | # Generators are not automatically loaded by rails
require 'generators/rspec/system/system_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::SystemGenerator, type: :generator do
setup_default_destination
describe "system specs" do
subject(:system_spec) { file("spec/system/posts_spec.rb... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/scaffold/scaffold_generator_spec.rb | spec/generators/rspec/scaffold/scaffold_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/scaffold/scaffold_generator'
require 'support/generators'
require 'rspec/support/spec/in_sub_process'
RSpec.describe Rspec::Generators::ScaffoldGenerator, type: :generator do
include RSpec::Support::InSubProcess
setup_default_destination
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/mailer/mailer_generator_spec.rb | spec/generators/rspec/mailer/mailer_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/mailer/mailer_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::MailerGenerator, type: :generator do
setup_default_destination
describe 'mailer spec' do
subject(:filename) { file('spec/mailers/posts_mailer_spe... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/model/model_generator_spec.rb | spec/generators/rspec/model/model_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/model/model_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::ModelGenerator, type: :generator do
setup_default_destination
it 'runs both the model and fixture tasks' do
gen = generator %w[posts]
expect(ge... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/authentication/authentication_generator_spec.rb | spec/generators/rspec/authentication/authentication_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/authentication/authentication_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::AuthenticationGenerator, type: :generator do
setup_default_destination
it 'runs both the model and fixture tasks' do
gen = genera... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/generator/generator_generator_spec.rb | spec/generators/rspec/generator/generator_generator_spec.rb | require 'generators/rspec/generator/generator_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::GeneratorGenerator, type: :generator do
setup_default_destination
describe "generator specs" do
subject(:generator_spec) { file("spec/generator/posts_generator_spec.rb") }
before do
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/feature/feature_generator_spec.rb | spec/generators/rspec/feature/feature_generator_spec.rb | # Generators are not automatically loaded by rails
require 'generators/rspec/feature/feature_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::FeatureGenerator, type: :generator do
setup_default_destination
describe 'feature specs' do
describe 'are generated independently from the comm... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/view/view_generator_spec.rb | spec/generators/rspec/view/view_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/view/view_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::ViewGenerator, type: :generator do
setup_default_destination
describe 'with default template engine' do
it 'generates a spec for the supplied action'... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/helper/helper_generator_spec.rb | spec/generators/rspec/helper/helper_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/helper/helper_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::HelperGenerator, type: :generator do
setup_default_destination
subject(:helper_spec) { file('spec/helpers/posts_helper_spec.rb') }
describe 'gener... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/mailbox/mailbox_generator_spec.rb | spec/generators/rspec/mailbox/mailbox_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/mailbox/mailbox_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::MailboxGenerator, type: :generator, skip: !RSpec::Rails::FeatureCheck.has_action_mailbox? do
setup_default_destination
describe 'the generated file... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/channel/channel_generator_spec.rb | spec/generators/rspec/channel/channel_generator_spec.rb | # Generators are not automatically loaded by Rails
require "generators/rspec/channel/channel_generator"
require 'support/generators'
RSpec.describe Rspec::Generators::ChannelGenerator, type: :generator, skip: !RSpec::Rails::FeatureCheck.has_action_cable_testing? do
setup_default_destination
before { run_generator... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/request/request_generator_spec.rb | spec/generators/rspec/request/request_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/request/request_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::RequestGenerator, type: :generator do
setup_default_destination
it_behaves_like "a request spec generator"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/job/job_generator_spec.rb | spec/generators/rspec/job/job_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/job/job_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::JobGenerator, type: :generator, skip: !RSpec::Rails::FeatureCheck.has_active_job? do
setup_default_destination
describe 'the generated files' do
before... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/spec/generators/rspec/install/install_generator_spec.rb | spec/generators/rspec/install/install_generator_spec.rb | # Generators are not automatically loaded by Rails
require 'generators/rspec/install/install_generator'
require 'support/generators'
RSpec.describe Rspec::Generators::InstallGenerator, type: :generator do
def use_active_record_migration
match(/ActiveRecord::Migration\./m)
end
def content_for(file_name)
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec-rails.rb | lib/rspec-rails.rb | require 'rspec/rails/feature_check'
# Namespace for all core RSpec projects.
module RSpec
# Namespace for rspec-rails code.
module Rails
# Railtie to hook into Rails.
class Railtie < ::Rails::Railtie
# As of Rails 5.1.0 you can register directories to work with `rake notes`
require 'rails/sourc... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails.rb | lib/rspec/rails.rb | require 'rspec/core'
require 'rails/version'
# Load any of our adapters and extensions early in the process
require 'rspec/rails/adapters'
require 'rspec/rails/extensions'
# Load the rspec-rails parts
require 'rspec/rails/view_rendering'
require 'rspec/rails/matchers'
require 'rspec/rails/fixture_support'
require 'rs... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/active_record.rb | lib/rspec/rails/active_record.rb | module RSpec
module Rails
# Fake class to document RSpec ActiveRecord configuration options. In practice,
# these are dynamically added to the normal RSpec configuration object.
class ActiveRecordConfiguration
# @private
def self.initialize_activerecord_configuration(config)
config.bef... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/version.rb | lib/rspec/rails/version.rb | module RSpec
module Rails
# Version information for RSpec Rails.
module Version
# Current version of RSpec Rails, in semantic versioning format.
STRING = '8.1.0.pre'
end
end
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers.rb | lib/rspec/rails/matchers.rb | require 'rspec/core/warnings'
require 'rspec/expectations'
require 'rspec/rails/feature_check'
module RSpec
module Rails
# @api public
# Container module for Rails specific matchers.
module Matchers
end
end
end
require 'rspec/rails/matchers/base_matcher'
require 'rspec/rails/matchers/have_rendered... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/extensions.rb | lib/rspec/rails/extensions.rb | require 'rspec/rails/extensions/active_record/proxy'
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/feature_check.rb | lib/rspec/rails/feature_check.rb | module RSpec
module Rails
# @private
module FeatureCheck
module_function
def has_active_job?
defined?(::ActiveJob)
end
def has_active_record?
defined?(::ActiveRecord)
end
def has_active_record_migration?
has_active_record? && defined?(::ActiveRecor... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/view_spec_methods.rb | lib/rspec/rails/view_spec_methods.rb | module RSpec
module Rails
# Adds methods (generally to ActionView::TestCase::TestController).
# Intended for use in view specs.
module ViewSpecMethods
module_function
# Adds methods `extra_params=` and `extra_params` to the indicated class.
# When class is `::ActionView::TestCase::TestC... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/fixture_support.rb | lib/rspec/rails/fixture_support.rb | module RSpec
module Rails
# @private
module FixtureSupport
if defined?(ActiveRecord::TestFixtures)
extend ActiveSupport::Concern
include RSpec::Rails::SetupAndTeardownAdapter
include RSpec::Rails::MinitestLifecycleAdapter
include RSpec::Rails::MinitestAssertionAdapter
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/configuration.rb | lib/rspec/rails/configuration.rb | module RSpec
module Rails
# Fake class to document RSpec Rails configuration options. In practice,
# these are dynamically added to the normal RSpec configuration object.
class Configuration
# @!method infer_spec_type_from_file_location!
# Automatically tag specs in conventional directories wi... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/view_rendering.rb | lib/rspec/rails/view_rendering.rb | require 'action_view/testing/resolvers'
module RSpec
module Rails
# @api public
# Helpers for optionally rendering views in controller specs.
module ViewRendering
extend ActiveSupport::Concern
# @!attribute [r]
# Returns the controller object instance under test.
attr_reader :con... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/file_fixture_support.rb | lib/rspec/rails/file_fixture_support.rb | require 'active_support/testing/file_fixtures'
module RSpec
module Rails
# @private
module FileFixtureSupport
extend ActiveSupport::Concern
include ActiveSupport::Testing::FileFixtures
included do
self.file_fixture_path = RSpec.configuration.file_fixture_path
if defined?(Ac... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/view_path_builder.rb | lib/rspec/rails/view_path_builder.rb | module RSpec
module Rails
# Builds paths for view specs using a particular route set.
class ViewPathBuilder
def initialize(route_set)
self.class.send(:include, route_set.url_helpers)
end
# Given a hash of parameters, build a view path, if possible.
# Returns nil if no path can... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example.rb | lib/rspec/rails/example.rb | require 'rspec/rails/example/rails_example_group'
require 'rspec/rails/example/controller_example_group'
require 'rspec/rails/example/request_example_group'
require 'rspec/rails/example/helper_example_group'
require 'rspec/rails/example/view_example_group'
require 'rspec/rails/example/mailer_example_group'
require 'rsp... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/adapters.rb | lib/rspec/rails/adapters.rb | require 'delegate'
require 'active_support'
require 'active_support/concern'
require 'active_support/core_ext/string'
module RSpec
module Rails
# @private
def self.disable_testunit_autorun
# `Test::Unit::AutoRunner.need_auto_run=` was introduced to the test-unit
# gem in version 2.4.9. Previous t... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/view_assigns.rb | lib/rspec/rails/view_assigns.rb | module RSpec
module Rails
# Helpers for making instance variables available to views.
module ViewAssigns
# Assigns a value to an instance variable in the scope of the
# view being rendered.
#
# @example
#
# assign(:widget, stub_model(Widget))
def assign(key, value... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/fixture_file_upload_support.rb | lib/rspec/rails/fixture_file_upload_support.rb | module RSpec
module Rails
# @private
module FixtureFileUploadSupport
delegate :fixture_file_upload, to: :rails_fixture_file_wrapper
private
# In Rails 7.0 fixture file path needs to be relative to `file_fixture_path` instead, this change
# was brought in with a deprecation warning on 6... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/vendor/capybara.rb | lib/rspec/rails/vendor/capybara.rb | begin
require 'capybara/rspec'
rescue LoadError
end
begin
require 'capybara/rails'
rescue LoadError
end
if defined?(Capybara)
RSpec.configure do |c|
if defined?(Capybara::DSL)
c.include Capybara::DSL, type: :feature
c.include Capybara::DSL, type: :system
end
if defined?(Capybara::RSpecM... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/extensions/active_record/proxy.rb | lib/rspec/rails/extensions/active_record/proxy.rb | RSpec.configure do |rspec|
# Delay this in order to give users a chance to configure `expect_with`...
rspec.before(:suite) do
if defined?(RSpec::Matchers) &&
RSpec::Matchers.configuration.respond_to?(:syntax) && # RSpec 4 dropped support for monkey-patching `should` syntax
RSpec::Matchers.config... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/routing_example_group.rb | lib/rspec/rails/example/routing_example_group.rb | module RSpec
module Rails
# @private
RoutingAssertionDelegator = RSpec::Rails::AssertionDelegator.new(
ActionDispatch::Assertions::RoutingAssertions
)
# @api public
# Container module for routing spec functionality.
module RoutingExampleGroup
extend ActiveSupport::Concern
i... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/request_example_group.rb | lib/rspec/rails/example/request_example_group.rb | module RSpec
module Rails
# @api public
# Container class for request spec functionality.
module RequestExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
include ActionDispatch::Integration::Runner
include ActionDispatch::Assertions
include RS... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/feature_example_group.rb | lib/rspec/rails/example/feature_example_group.rb | module RSpec
module Rails
# @api public
# Container module for routing spec functionality.
module FeatureExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
# Default host to be used in Rails route helpers if none is specified.
DEFAULT_HOST = "www.ex... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/view_example_group.rb | lib/rspec/rails/example/view_example_group.rb | require 'rspec/rails/view_assigns'
require 'rspec/rails/view_spec_methods'
require 'rspec/rails/view_path_builder'
module RSpec
module Rails
# @api public
# Container class for view spec functionality.
module ViewExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGro... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/helper_example_group.rb | lib/rspec/rails/example/helper_example_group.rb | require 'rspec/rails/view_assigns'
module RSpec
module Rails
# @api public
# Container module for helper specs.
module HelperExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
include ActionView::TestCase::Behavior
include RSpec::Rails::ViewAssigns
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/controller_example_group.rb | lib/rspec/rails/example/controller_example_group.rb | module RSpec
module Rails
# @private
ControllerAssertionDelegator = RSpec::Rails::AssertionDelegator.new(
ActionDispatch::Assertions::RoutingAssertions
)
# @api public
# Container module for controller spec functionality.
module ControllerExampleGroup
extend ActiveSupport::Concern... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/job_example_group.rb | lib/rspec/rails/example/job_example_group.rb | module RSpec
module Rails
# @api public
# Container module for job spec functionality. It is only available if
# ActiveJob has been loaded before it.
module JobExampleGroup
# This blank module is only necessary for YARD processing. It doesn't
# handle the conditional `defined?` check below... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/mailer_example_group.rb | lib/rspec/rails/example/mailer_example_group.rb | module RSpec
module Rails
# @api public
# Container module for mailer spec functionality. It is only available if
# ActionMailer has been loaded before it.
module MailerExampleGroup
# This blank module is only necessary for YARD processing. It doesn't
# handle the conditional `defined?` ch... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/model_example_group.rb | lib/rspec/rails/example/model_example_group.rb | module RSpec
module Rails
# @api public
# Container class for model spec functionality. Does not provide anything
# special over the common RailsExampleGroup currently.
module ModelExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
end
end
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/channel_example_group.rb | lib/rspec/rails/example/channel_example_group.rb | require "rspec/rails/matchers/action_cable/have_streams"
module RSpec
module Rails
# @api public
# Container module for channel spec functionality. It is only available if
# ActionCable has been loaded before it.
module ChannelExampleGroup
# @private
module ClassMethods
# These bl... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/mailbox_example_group.rb | lib/rspec/rails/example/mailbox_example_group.rb | module RSpec
module Rails
# @api public
# Container module for mailbox spec functionality.
module MailboxExampleGroup
extend ActiveSupport::Concern
if RSpec::Rails::FeatureCheck.has_action_mailbox?
require 'action_mailbox/test_helper'
extend ::ActionMailbox::TestHelper
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/rails_example_group.rb | lib/rspec/rails/example/rails_example_group.rb | # Temporary workaround to resolve circular dependency between rspec-rails' spec
# suite and ammeter.
require 'rspec/rails/matchers'
require 'active_support/current_attributes/test_helper'
require 'active_support/execution_context/test_helper'
module RSpec
module Rails
# @api public
# Common rails example fu... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/example/system_example_group.rb | lib/rspec/rails/example/system_example_group.rb | module RSpec
module Rails
# @api public
# Container class for system tests
module SystemExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
include RSpec::Rails::Matchers::RedirectTo
include RSpec::Rails::Matchers::RenderTemplate
include ActionD... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/base_matcher.rb | lib/rspec/rails/matchers/base_matcher.rb | module RSpec
module Rails
module Matchers
# @api private
#
# Base class to build matchers. Should not be instantiated directly.
class BaseMatcher
include RSpec::Matchers::Composable
# @api private
# Used to detect when no arg is passed to `initialize`.
# `n... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/have_enqueued_mail.rb | lib/rspec/rails/matchers/have_enqueued_mail.rb | # We require the minimum amount of rspec-mocks possible to avoid
# conflicts with other mocking frameworks.
# See: https://github.com/rspec/rspec-rails/issues/2252
require "rspec/mocks/argument_matchers"
require "rspec/rails/matchers/active_job"
# rubocop: disable Metrics/ClassLength
module RSpec
module Rails
mo... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/active_job.rb | lib/rspec/rails/matchers/active_job.rb | require "active_job/base"
require "active_job/arguments"
module RSpec
module Rails
module Matchers
# Namespace for various implementations of ActiveJob features
#
# @api private
module ActiveJob
# rubocop: disable Metrics/ClassLength
# @private
class Base < RSpec::... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/action_cable.rb | lib/rspec/rails/matchers/action_cable.rb | require "rspec/rails/matchers/action_cable/have_broadcasted_to"
module RSpec
module Rails
module Matchers
extend RSpec::Matchers::DSL
# Namespace for various implementations of ActionCable features
#
# @api private
module ActionCable
end
# @api public
# Passes if... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/action_mailbox.rb | lib/rspec/rails/matchers/action_mailbox.rb | module RSpec
module Rails
module Matchers
# Namespace for various implementations of ActionMailbox features
#
# @api private
module ActionMailbox
# @private
class Base < RSpec::Rails::Matchers::BaseMatcher
private
def create_inbound_email(message)
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/be_valid.rb | lib/rspec/rails/matchers/be_valid.rb | module RSpec
module Rails
module Matchers
# @private
class BeValid < RSpec::Matchers::BuiltIn::Be
def initialize(*args)
@args = args
end
def matches?(actual)
@actual = actual
actual.valid?(*@args)
end
def failure_message
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/have_rendered.rb | lib/rspec/rails/matchers/have_rendered.rb | module RSpec
module Rails
module Matchers
# Matcher for template rendering.
module RenderTemplate
# @private
class RenderTemplateMatcher < RSpec::Rails::Matchers::BaseMatcher
def initialize(scope, expected, message = nil)
@expected = Symbol === expected ? expected... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/have_http_status.rb | lib/rspec/rails/matchers/have_http_status.rb | # The following code inspired and modified from Rails' `assert_response`:
#
# https://github.com/rails/rails/blob/main/actionpack/lib/action_dispatch/testing/assertions/response.rb#L22-L38
#
# Thank you to all the Rails devs who did the heavy lifting on this!
module RSpec
module Rails
module Matchers
# N... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/redirect_to.rb | lib/rspec/rails/matchers/redirect_to.rb | module RSpec
module Rails
module Matchers
# Matcher for redirects.
module RedirectTo
# @private
class RedirectTo < RSpec::Rails::Matchers::BaseMatcher
def initialize(scope, expected)
@expected = expected
@scope = scope
end
def matc... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/be_a_new.rb | lib/rspec/rails/matchers/be_a_new.rb | module RSpec
module Rails
module Matchers
# @api private
#
# Matcher class for `be_a_new`. Should not be instantiated directly.
#
# @see RSpec::Rails::Matchers#be_a_new
class BeANew < RSpec::Rails::Matchers::BaseMatcher
# @private
def initialize(expected)
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/routing_matchers.rb | lib/rspec/rails/matchers/routing_matchers.rb | module RSpec
module Rails
module Matchers
# Matchers to help with specs for routing code.
module RoutingMatchers
extend RSpec::Matchers::DSL
# @private
class RouteToMatcher < RSpec::Rails::Matchers::BaseMatcher
def initialize(scope, *expected)
@scope = sc... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/be_new_record.rb | lib/rspec/rails/matchers/be_new_record.rb | module RSpec
module Rails
module Matchers
# @private
class BeANewRecord < RSpec::Rails::Matchers::BaseMatcher
def matches?(actual)
actual.new_record?
end
def failure_message
"expected #{actual.inspect} to be a new record, but was persisted"
end
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/relation_match_array.rb | lib/rspec/rails/matchers/relation_match_array.rb | if defined?(ActiveRecord::Relation) && defined?(RSpec::Matchers::BuiltIn::OperatorMatcher) # RSpec 4 removed OperatorMatcher
RSpec::Matchers::BuiltIn::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::BuiltIn::ContainExactly)
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/send_email.rb | lib/rspec/rails/matchers/send_email.rb | # frozen_string_literal: true
module RSpec
module Rails
module Matchers
# @api private
#
# Matcher class for `send_email`. Should not be instantiated directly.
#
# @see RSpec::Rails::Matchers#send_email
class SendEmail < RSpec::Rails::Matchers::BaseMatcher
# @api priva... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/action_cable/have_streams.rb | lib/rspec/rails/matchers/action_cable/have_streams.rb | module RSpec
module Rails
module Matchers
module ActionCable
# @api private
# Provides the implementation for `have_stream`, `have_stream_for`, and `have_stream_from`.
# Not intended to be instantiated directly.
class HaveStream < RSpec::Matchers::BuiltIn::BaseMatcher
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb | lib/rspec/rails/matchers/action_cable/have_broadcasted_to.rb | module RSpec
module Rails
module Matchers
module ActionCable
# rubocop: disable Metrics/ClassLength
# @private
class HaveBroadcastedTo < RSpec::Matchers::BuiltIn::BaseMatcher
def initialize(target, channel:)
@target = target
@channel = channel
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec.rb | lib/generators/rspec.rb | require 'rails/generators/named_base'
require 'rspec/core'
require 'rspec/rails/feature_check'
# @private
# Weirdly named generators namespace (should be `RSpec`) for compatibility with
# rails loading.
module Rspec
# @private
module Generators
# @private
class Base < ::Rails::Generators::NamedBase
i... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/controller/controller_generator.rb | lib/generators/rspec/controller/controller_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class ControllerGenerator < Base
argument :actions, type: :array, default: [], banner: "action action"
class_option :template_engine, desc: "Template engine to generate view files"
class_option :request_specs, type: :... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/controller/templates/routing_spec.rb | lib/generators/rspec/controller/templates/routing_spec.rb | require 'rails_helper'
<% module_namespacing do -%>
RSpec.describe '<%= class_name %>Controller', <%= type_metatag(:routing) %> do
describe 'routing' do
<% for action in actions -%>
it 'routes to #<%= action %>' do
expect(get: "/<%= class_name.underscore %>/<%= action %>").to route_to("<%= class_name.under... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/controller/templates/view_spec.rb | lib/generators/rspec/controller/templates/view_spec.rb | require 'rails_helper'
RSpec.describe "<%= file_name %>/<%= @action %>.html.<%= options[:template_engine] %>", <%= type_metatag(:view) %> do
pending "add some examples to (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/controller/templates/request_spec.rb | lib/generators/rspec/controller/templates/request_spec.rb | require 'rails_helper'
RSpec.describe "<%= class_name.pluralize %>", <%= type_metatag(:request) %> do
<% namespaced_path = regular_class_path.join('/') -%>
<% if actions.empty? -%>
describe "GET /index" do
pending "add some examples (or delete) #{__FILE__}"
end
<% end -%>
<% for action in actions -%>
describ... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/controller/templates/controller_spec.rb | lib/generators/rspec/controller/templates/controller_spec.rb | require 'rails_helper'
<% module_namespacing do -%>
RSpec.describe <%= class_name %>Controller, <%= type_metatag(:controller) %> do
<% for action in actions -%>
describe "GET #<%= action %>" do
it "returns http success" do
get :<%= action %>
expect(response).to have_http_status(:success)
end
e... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/system/system_generator.rb | lib/generators/rspec/system/system_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class SystemGenerator < Base
class_option :system_specs, type: :boolean, default: true, desc: "Generate system specs"
def generate_system_spec
return unless options[:system_specs]
template template_name, targe... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/system/templates/system_spec.rb | lib/generators/rspec/system/templates/system_spec.rb | require 'rails_helper'
RSpec.describe "<%= class_name.pluralize %>", <%= type_metatag(:system) %> do
before do
driven_by(:rack_test)
end
pending "add some scenarios (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/scaffold_generator.rb | lib/generators/rspec/scaffold/scaffold_generator.rb | require 'generators/rspec'
require 'rails/generators/resource_helpers'
module Rspec
module Generators
# @private
class ScaffoldGenerator < Base
include ::Rails::Generators::ResourceHelpers
source_paths << File.expand_path('../helper/templates', __dir__)
argument :attributes, type: :array, d... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/show_spec.rb | lib/generators/rspec/scaffold/templates/show_spec.rb | require 'rails_helper'
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
RSpec.describe "<%= ns_table_name %>/show", <%= type_metatag(:view) %> do
before(:each) do
assign(:<%= singular_table_name %>, <%= class_name %>.create!(<%= '))' if output... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/routing_spec.rb | lib/generators/rspec/scaffold/templates/routing_spec.rb | require "rails_helper"
<% module_namespacing do -%>
RSpec.describe <%= controller_class_name %>Controller, <%= type_metatag(:routing) %> do
describe "routing" do
<% unless options[:singleton] -%>
it "routes to #index" do
expect(get: "/<%= ns_table_name %>").to route_to("<%= ns_table_name %>#index")
end... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/new_spec.rb | lib/generators/rspec/scaffold/templates/new_spec.rb | require 'rails_helper'
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
RSpec.describe "<%= ns_table_name %>/new", <%= type_metatag(:view) %> do
before(:each) do
assign(:<%= singular_table_name %>, <%= class_name %>.new(<%= '))' if output_attr... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/api_request_spec.rb | lib/generators/rspec/scaffold/templates/api_request_spec.rb | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to test the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# ... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/request_spec.rb | lib/generators/rspec/scaffold/templates/request_spec.rb | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to test the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# ... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/controller_spec.rb | lib/generators/rspec/scaffold/templates/controller_spec.rb | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/api_controller_spec.rb | lib/generators/rspec/scaffold/templates/api_controller_spec.rb | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/edit_spec.rb | lib/generators/rspec/scaffold/templates/edit_spec.rb | require 'rails_helper'
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
RSpec.describe "<%= ns_table_name %>/edit", <%= type_metatag(:view) %> do
let(:<%= singular_table_name %>) {
<%= class_name %>.create!(<%= ')' if output_attributes.empty? ... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/scaffold/templates/index_spec.rb | lib/generators/rspec/scaffold/templates/index_spec.rb | require 'rails_helper'
<% output_attributes = attributes.reject{|attribute| [:datetime, :timestamp, :time, :date].index(attribute.type) } -%>
RSpec.describe "<%= ns_table_name %>/index", <%= type_metatag(:view) %> do
before(:each) do
assign(:<%= table_name %>, [
<% [1,2].each_with_index do |id, model_index| -%>
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/mailer/mailer_generator.rb | lib/generators/rspec/mailer/mailer_generator.rb | require 'generators/rspec'
require "rspec/rails/feature_check"
module Rspec
module Generators
# @private
class MailerGenerator < Base
argument :actions, type: :array, default: [], banner: "method method"
def generate_mailer_spec
file_suffix = file_name.end_with?('mailer') ? 'spec.rb' : '... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/mailer/templates/preview.rb | lib/generators/rspec/mailer/templates/preview.rb | <% module_namespacing do -%>
# Preview all emails at http://localhost:3000/rails/mailers/<%= file_path %>_mailer
class <%= class_name %><%= 'Mailer' unless class_name.end_with?('Mailer') %>Preview < ActionMailer::Preview
<% actions.each do |action| -%>
# Preview this email at http://localhost:3000/rails/mailers/<%= ... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/mailer/templates/mailer_spec.rb | lib/generators/rspec/mailer/templates/mailer_spec.rb | require "rails_helper"
<% module_namespacing do -%>
RSpec.describe <%= class_name.sub(/(Mailer)?$/, 'Mailer') %>, <%= type_metatag(:mailer) %> do
<% for action in actions -%>
describe "<%= action %>" do
let(:mail) { <%= class_name.sub(/(Mailer)?$/, 'Mailer') %>.<%= action %> }
it "renders the headers" do
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/model/model_generator.rb | lib/generators/rspec/model/model_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class ModelGenerator < Base
argument :attributes,
type: :array,
default: [],
banner: "field:type field:type"
class_option :fixture, type: :boolean
def create_model_spec
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/model/templates/model_spec.rb | lib/generators/rspec/model/templates/model_spec.rb | require 'rails_helper'
<% module_namespacing do -%>
RSpec.describe <%= class_name %>, <%= type_metatag(:model) %> do
pending "add some examples to (or delete) #{__FILE__}"
end
<% end -%>
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/authentication/authentication_generator.rb | lib/generators/rspec/authentication/authentication_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class AuthenticationGenerator < Base
def initialize(args, *options)
args.replace(['User'])
super
end
def create_user_spec
template 'user_spec.rb', target_path('models', 'user_spec.rb')
end
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/authentication/templates/user_spec.rb | lib/generators/rspec/authentication/templates/user_spec.rb | require 'rails_helper'
RSpec.describe User, <%= type_metatag(:model) %> do
pending "add some examples to (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/generator/generator_generator.rb | lib/generators/rspec/generator/generator_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class GeneratorGenerator < Base
class_option :generator_specs, type: :boolean, default: true, desc: 'Generate generator specs'
def generate_generator_spec
return unless options[:generator_specs]
template templa... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/generator/templates/generator_spec.rb | lib/generators/rspec/generator/templates/generator_spec.rb | require 'rails_helper'
RSpec.describe "<%= class_name %>Generator", <%= type_metatag(:generator) %> do
pending "add some scenarios (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/feature/feature_generator.rb | lib/generators/rspec/feature/feature_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class FeatureGenerator < Base
class_option :feature_specs, type: :boolean, default: true, desc: "Generate feature specs"
class_option :singularize, type: :boolean, default: false, desc: "Singularize the generated feature"
... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/feature/templates/feature_singular_spec.rb | lib/generators/rspec/feature/templates/feature_singular_spec.rb | require 'rails_helper'
RSpec.feature "<%= class_name.singularize %>", <%= type_metatag(:feature) %> do
pending "add some scenarios (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/feature/templates/feature_spec.rb | lib/generators/rspec/feature/templates/feature_spec.rb | require 'rails_helper'
RSpec.feature "<%= class_name.pluralize %>", <%= type_metatag(:feature) %> do
pending "add some scenarios (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/view/view_generator.rb | lib/generators/rspec/view/view_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class ViewGenerator < Base
argument :actions, type: :array, default: [], banner: "action action"
class_option :template_engine, desc: "Template engine to generate view files"
def create_view_specs
empty_directory... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/view/templates/view_spec.rb | lib/generators/rspec/view/templates/view_spec.rb | require 'rails_helper'
RSpec.describe "<%= file_path %>/<%= @action %>", <%= type_metatag(:view) %> do
pending "add some examples to (or delete) #{__FILE__}"
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/helper/helper_generator.rb | lib/generators/rspec/helper/helper_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class HelperGenerator < Base
class_option :helper_specs, type: :boolean, default: true
def generate_helper_spec
return unless options[:helper_specs]
template 'helper_spec.rb', target_path('helpers', class_path,... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/helper/templates/helper_spec.rb | lib/generators/rspec/helper/templates/helper_spec.rb | require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the <%= class_name %>Helper. For example:
#
# describe <%= class_name %>Helper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this tha... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/mailbox/mailbox_generator.rb | lib/generators/rspec/mailbox/mailbox_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class MailboxGenerator < Base
def create_mailbox_spec
template('mailbox_spec.rb.erb',
target_path('mailboxes', class_path, "#{file_name}_mailbox_spec.rb")
)
end
end
end
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/channel/channel_generator.rb | lib/generators/rspec/channel/channel_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class ChannelGenerator < Base
def create_channel_spec
template 'channel_spec.rb.erb', target_path('channels', class_path, "#{file_name}_channel_spec.rb")
end
end
end
end
| ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
rspec/rspec-rails | https://github.com/rspec/rspec-rails/blob/f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df/lib/generators/rspec/request/request_generator.rb | lib/generators/rspec/request/request_generator.rb | require 'generators/rspec'
module Rspec
module Generators
# @private
class RequestGenerator < Base
class_option :request_specs, type: :boolean, default: true, desc: 'Generate request specs'
def generate_request_spec
return unless options[:request_specs]
template 'request_spec.rb... | ruby | MIT | f16a1639b5c2af5cde1ad1682b5c7a4af7f7b3df | 2026-01-04T15:43:26.158415Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.