[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8032":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":16,"starSnapshotCount":16,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},8032,"rspec-rails-examples","eliotsykes\u002Frspec-rails-examples","eliotsykes","RSpec cheatsheet & Rails app: Learn how to expertly test Rails apps from a model codebase","",null,"Ruby",2149,308,80,34,0,1,29.47,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35,36],"factory-girl","learning-rspec","rails","rails-application","rails-tutorial","rspec-cheatsheet","rspec-examples","rspec-matchers","rspec-rails","rspec-testing","ruby","ruby-on-rails","shoulda-matchers","2026-06-12 02:01:48","# RSpec Rails Examples [![Build Status](https:\u002F\u002Ftravis-ci.org\u002Feliotsykes\u002Frspec-rails-examples.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Feliotsykes\u002Frspec-rails-examples) [![Join the chat at https:\u002F\u002Fgitter.im\u002Feliotsykes\u002Frspec-rails-examples](https:\u002F\u002Fbadges.gitter.im\u002FJoin%20Chat.svg)](https:\u002F\u002Fgitter.im\u002Feliotsykes\u002Frspec-rails-examples?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n> An RSpec cheatsheet in the form of a Rails app. Learn how to expertly test Rails apps from a model codebase\n\nA small yet comprehensive reference for developers who want to know how to test Rails apps using RSpec.\n\nHere you'll find in-depth examples with detailed documentation explaining how to test with RSpec and related testing gems, which you can then apply to your own projects.\n\nThis application was originally written for the benefit of the developers I coach, who've found it a useful memory aid and catalyst for when they're learning RSpec. Now I'd like to get feedback from the wider community.\n\nThe repo contains examples of various spec types such as feature, mailer, and model. See the [spec\u002F](spec\u002F) directory for all the example specs and types.\n\nIn the README below, you'll find links to some of the most useful cheatsheets and API documentation available for RSpec users.\n\nSee the well-commented files in the [spec\u002Fsupport](spec\u002Fsupport) directory for walkthroughs on how to configure popular testing gems, such as DatabaseCleaner, Capybara, and FactoryGirl.\n\nHopefully this will be of help to those of you learning RSpec and Rails. If there's anything missing you'd like to see covered in the project, please submit your request via the [issue tracker](https:\u002F\u002Fgithub.com\u002Feliotsykes\u002Frspec-rails-examples\u002Fissues), I'd be happy to help &mdash; [_Eliot Sykes_](https:\u002F\u002Feliotsykes.com)\n\n**PS. Interested in growing your skills *and* supporting this project?** Learn with the [TDD Masterclass](https:\u002F\u002Feliotsykes.com\u002F#tdd), get [Test Coverage First Aid](https:\u002F\u002Feliotsykes.com\u002F#coverage) for your app, or grow with [one-to-one coaching for Rails developers](https:\u002F\u002Feliotsykes.com\u002F#coach).\n\n---\n\n\u003C!-- MarkdownTOC depth=0 autolink=true bracket=round -->\n\n- [Support Configuration](#support-configuration)\n- [Run Specs in a Random Order](#run-specs-in-a-random-order)\n- [Testing Production Errors](#testing-production-errors)\n- [Testing Rake Tasks with RSpec](#testing-rake-tasks-with-rspec)\n- [Pry-rescue debugging](#pry-rescue-debugging)\n- [Time Travel Examples](#time-travel-examples)\n- [ActiveJob Examples](#activejob-examples)\n- [Database Cleaner Examples](#database-cleaner-examples)\n- [Factory Girl Examples](#factory-girl-examples)\n- [VCR Examples](#vcr-examples)\n- [Capybara Examples](#capybara-examples)\n- [Puffing Billy Examples](#puffing-billy-examples)\n- [Shoulda-Matchers Examples](#shoulda-matchers-examples)\n- [Email-Spec Examples](#email-spec-examples)\n- [Devise Examples](#devise-examples)\n- [Custom Matchers](#custom-matchers)\n- [RSpec-Expectations Docs](#rspec-expectations-docs)\n- [RSpec-Mocks Specs & Docs](#rspec-mocks-specs--docs)\n- [RSpec-Rails](#rspec-rails)\n  - [Matchers](#matchers)\n  - [Generators](#generators)\n  - [Feature Specs & Docs](#feature-specs--docs)\n  - [API Request Specs, Docs, & Helpers](#api-request-specs-docs--helpers)\n  - [Mailer Specs & Docs](#mailer-specs--docs)\n  - [Controller Specs & Docs](#controller-specs--docs)\n  - [View Specs & Docs](#view-specs--docs)\n  - [Helper Specs & Docs](#helper-specs--docs)\n  - [Routing Specs & Docs](#routing-specs--docs)\n- [Validator Specs](#validator-specs)\n- [Enable Spring for RSpec](#enable-spring-for-rspec)\n- [Automated Continuous Integration with Travis CI](#automated-continuous-integration-with-travis-ci)\n- [Contributors](#contributors)\n\n\u003C!-- \u002FMarkdownTOC -->\n\n# Support Configuration\n\nThe tests rely on this configuration being uncommented in `spec\u002Frails_helper.rb`, you probably want it uncommented in your app too:\n```ruby\n# Loads `.rb` files in `spec\u002Fsupport` and its subdirectories:\nDir[Rails.root.join(\"spec\u002Fsupport\u002F**\u002F*.rb\")].each { |f| require f }\n```\n(The rspec-rails installer generates this line, but it will be commented out.)\n\n\n# Run Specs in a Random Order\n\nIn a dependable, repeatable automated test suite, data stores (such as database, job queues, and sent email on `ActionMailer::Base.deliveries`) should return to a consistent state between each spec, regardless of the order specs are run in.\n\nFor a maintainable, predictable test suite, one spec should not set up data (e.g. creating users) needed by a later spec to pass. Each spec should look after its own test data and clear up after itself. (NB. If there is reference data that all tests need, such as populating a `countries` table, then this can go in `db\u002Fseeds.rb` and be run once before the entire suite).\n\nThe specs run in a random order each time the test suite is run. This helps prevent the introduction of run order and test data dependencies between tests, which are best avoided.\n\nRandom order test runs are configured using the `config.order = :random` and `Kernel.srand config.seed` options in [spec\u002Fspec_helper.rb](spec\u002Fspec_helper.rb).\n\n\n# Testing Production Errors\n\nWhen errors are raised, the Rails test environment may not behave as in production. The test environment may mask the actual error response you want to test. To help with this, you can disable test environment exception handling temporarily, [spec\u002Fsupport\u002Ferror_responses.rb](spec\u002Fsupport\u002Ferror_responses.rb) provides `respond_without_detailed_exceptions`. See it in use in [spec\u002Fapi\u002Fv1\u002Ftoken_spec.rb](spec\u002Fapi\u002Fv1\u002Ftoken_spec.rb) to provide production-like error responses in the test environment.\n\n\n# Testing Rake Tasks with RSpec\n\nRSpec testing Rake task configuration and example:\n- [spec\u002Fsupport\u002Ftasks.rb](spec\u002Fsupport\u002Ftasks.rb) essential to load Rake tasks before specs run\n- [spec\u002Ftasks\u002Fsubscription_tasks_spec.rb](spec\u002Ftasks\u002Fsubscription_tasks_spec.rb)\n\n\n# Pry-rescue debugging\npry-rescue can be used to debug failing specs, by opening pry's debugger whenever a test failure is encountered. For setup and usage see [pry-rescue's README](https:\u002F\u002Fgithub.com\u002FConradIrwin\u002Fpry-rescue).\n\n\n# Time Travel Examples\n\n[`ActiveSupport::Testing::TimeHelpers`](http:\u002F\u002Fapi.rubyonrails.org\u002Fclasses\u002FActiveSupport\u002FTesting\u002FTimeHelpers.html) provides helpers for manipulating and freezing the current time reported within tests. These methods are often enough to replace the time-related testing methods that the `timecop` gem is used for.\n\n`TimeHelpers` configuration how-to and examples:\n- [spec\u002Fsupport\u002Ftime_helpers.rb](spec\u002Fsupport\u002Ftime_helpers.rb)\n- [spec\u002Fmodels\u002Fsubscription_spec.rb](spec\u002Fmodels\u002Fsubscription_spec.rb)\n- [spec\u002Ftasks\u002Fsubscription_tasks_spec.rb](spec\u002Ftasks\u002Fsubscription_tasks_spec.rb)\n- [`travel_to`](http:\u002F\u002Fapi.rubyonrails.org\u002Fclasses\u002FActiveSupport\u002FTesting\u002FTimeHelpers.html#method-i-travel_to) example: [spec\u002Fmodels\u002Fsubscription_spec.rb](spec\u002Fmodels\u002Fsubscription_spec.rb)\n- [`ActiveSupport::Testing::TimeHelpers` API documentation](http:\u002F\u002Fapi.rubyonrails.org\u002Fclasses\u002FActiveSupport\u002FTesting\u002FTimeHelpers.html)\n\n\n# ActiveJob Examples\n\n[`ActiveJob::TestHelper`](http:\u002F\u002Fapi.rubyonrails.org\u002Fclasses\u002FActiveJob\u002FTestHelper.html) provides help to test ActiveJob jobs.\n\n`ActiveJob::TestHelper` configuration how-to and examples:\n- [spec\u002Fsupport\u002Fjob_helpers.rb](spec\u002Fsupport\u002Fjob_helpers.rb)\n- [spec\u002Fjobs\u002Fheadline_scraper_job_spec.rb](spec\u002Fjobs\u002Fheadline_scraper_job_spec.rb)\n- [`ActiveJob::TestHelper` API documentation](http:\u002F\u002Fapi.rubyonrails.org\u002Fclasses\u002FActiveJob\u002FTestHelper.html)\n\n\n# Database Cleaner Examples\n\n[Database Cleaner](https:\u002F\u002Fgithub.com\u002FDatabaseCleaner\u002Fdatabase_cleaner) is a set of strategies for cleaning your database in Ruby, to ensure a consistent environment for each test run.\n\nDatabase Cleaner configuration how-to:\n- [spec\u002Fsupport\u002Fdatabase_cleaner.rb](spec\u002Fsupport\u002Fdatabase_cleaner.rb)\n\n\n# Factory Girl Examples\n\n[Factory Girl](https:\u002F\u002Fgithub.com\u002Fthoughtbot\u002Ffactory_girl) is a library to help setup test data. [factory_girl_rails](https:\u002F\u002Fgithub.com\u002Fthoughtbot\u002Ffactory_girl_rails) integrates Factory Girl with Rails.\n\nFactory Girl configuration how-to and examples:\n- [spec\u002Fsupport\u002Ffactory_girl.rb](spec\u002Fsupport\u002Ffactory_girl.rb)\n- [spec\u002Ffactories](spec\u002Ffactories)\n- [spec\u002Ffactories\u002Fusers.rb](spec\u002Ffactories\u002Fusers.rb)\n- [spec\u002Fmodels\u002Fsubscription_spec.rb](spec\u002Fmodels\u002Fsubscription_spec.rb)\n- [spec\u002Ftasks\u002Fsubscription_tasks_spec.rb](spec\u002Ftasks\u002Fsubscription_tasks_spec.rb)\n- [spec\u002Ffeatures\u002Fuser_login_and_logout_spec.rb](spec\u002Ffeatures\u002Fuser_login_and_logout_spec.rb)\n\n\n# VCR Examples\n\n[VCR](https:\u002F\u002Fgithub.com\u002Fvcr\u002Fvcr) records your test suite's HTTP interactions and replays them during future test runs. Your tests can run independent of a connection to external URLs. These HTTP interactions are stored in cassette files.\n\nVCR configuration how-to and examples:\n- [spec\u002Fsupport\u002Fvcr.rb](spec\u002Fsupport\u002Fvcr.rb)\n- [spec\u002Fjobs\u002Fheadline_scraper_job_spec.rb](spec\u002Fjobs\u002Fheadline_scraper_job_spec.rb)\n- [Cassette files in spec\u002Fsupport\u002Fhttp_cache\u002Fvcr](spec\u002Fsupport\u002Fhttp_cache\u002Fvcr)\n- [VCR Relish docs](https:\u002F\u002Frelishapp.com\u002Fvcr\u002Fvcr\u002Fdocs)\n- [VCR API docs](http:\u002F\u002Fwww.rubydoc.info\u002Fgems\u002Fvcr\u002Fframes)\n\n# Capybara Examples\n\n[Capybara](https:\u002F\u002Fgithub.com\u002Fjnicklas\u002Fcapybara) helps you write feature specs that interact with your app's UI as a user does with a browser.\n\nCapybara configuration how-to and examples:\n- [spec\u002Fsupport\u002Fcapybara.rb](spec\u002Fsupport\u002Fcapybara.rb)\n- [spec\u002Ffeatures\u002Fhome_page_spec.rb](spec\u002Ffeatures\u002Fhome_page_spec.rb)\n- [spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb](spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb)\n- [spec\u002Ffeatures\u002Fuser_login_and_logout_spec.rb](spec\u002Ffeatures\u002Fuser_login_and_logout_spec.rb)\n- [spec\u002Ffeatures\u002Fuser_registers_spec.rb](spec\u002Ffeatures\u002Fuser_registers_spec.rb)\n- [Capybara cheatsheet](https:\u002F\u002Fgist.github.com\u002Fzhengjia\u002F428105)\n- [Capybara matchers](http:\u002F\u002Fwww.rubydoc.info\u002Fgithub\u002Fjnicklas\u002Fcapybara\u002Fmaster\u002FCapybara\u002FNode\u002FMatchers)\n\n\n# Puffing Billy Examples\n\n[Puffing Billy](https:\u002F\u002Fgithub.com\u002Foesmith\u002Fpuffing-billy) is like VCR for browsers used by feature specs. Puffing Billy is a HTTP proxy between your browser and external sites, including 3rd party JavaScript. If your app depends on JavaScript hosted on another site, then Puffing Billy will keep a copy of that JavaScript and serve it from a local web server during testing. This means tests dependent on that JavaScript will carry on working even if the original host cannot be connected to.\n\nIf you need to debug Puffing Billy, refer to its output in `log\u002Ftest.log`.\n\nPuffing Billy configuration how-to and examples:\n- [spec\u002Fsupport\u002Fpuffing_billy.rb](spec\u002Fsupport\u002Fpuffing_billy.rb)\n- [spec\u002Ffeatures\u002Fshare_page_spec.rb](spec\u002Ffeatures\u002Fshare_page_spec.rb)\n- [Cache options](https:\u002F\u002Fgithub.com\u002Foesmith\u002Fpuffing-billy#caching)\n- [Cached responses in spec\u002Fsupport\u002Fhttp_cache\u002Fbilly](spec\u002Fsupport\u002Fhttp_cache\u002Fbilly)\n\n\n# Shoulda-Matchers Examples\n\n[Shoulda-matchers](https:\u002F\u002Fgithub.com\u002Fthoughtbot\u002Fshoulda-matchers) make light work of model specs.\n\nshoulda-matchers configuration how-to and examples:\n- [spec\u002Fsupport\u002Fshoulda_matchers.rb](spec\u002Fsupport\u002Fshoulda_matchers.rb)\n- [spec\u002Fmodels\u002Fsubscription_spec.rb](spec\u002Fmodels\u002Fsubscription_spec.rb)\n\n\n# Email-Spec Examples\n\nThe \"Subscribe to newsletter\" feature was developed with help from [email_spec](https:\u002F\u002Fgithub.com\u002Fbmabey\u002Femail-spec)\n\nemail_spec configuration how-to and examples:\n- [spec\u002Fsupport\u002Femail_spec.rb](spec\u002Fsupport\u002Femail_spec.rb)\n- [spec\u002Fjobs\u002Fheadline_scraper_job_spec.rb](spec\u002Fjobs\u002Fheadline_scraper_job_spec.rb)\n- [spec\u002Fmailers\u002Fnews_mailer_spec.rb](spec\u002Fmailers\u002Fnews_mailer_spec.rb)\n- [spec\u002Fmailers\u002Fsubscription_mailer_spec.rb](spec\u002Fmailers\u002Fsubscription_mailer_spec.rb)\n- [spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb](spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb)\n- [spec\u002Ffeatures\u002Fuser_registers_spec.rb](spec\u002Ffeatures\u002Fuser_registers_spec.rb)\n- [`EmailSpec::Helpers` API documentation](http:\u002F\u002Fwww.rubydoc.info\u002Fgems\u002Femail_spec\u002FEmailSpec\u002FHelpers)\n- [`EmailSpec::Matchers` API documentation](http:\u002F\u002Fwww.rubydoc.info\u002Fgems\u002Femail_spec\u002FEmailSpec\u002FMatchers)\n\n\n# Devise Examples\n\nSpecs testing registration, sign-in, and other user authentication features provided by Devise:\n\n- [spec\u002Ffeatures\u002Fuser_login_and_logout_spec.rb](spec\u002Ffeatures\u002Fuser_login_and_logout_spec.rb)\n- [spec\u002Ffeatures\u002Fuser_registers_spec.rb](spec\u002Ffeatures\u002Fuser_registers_spec.rb)\n\n\n# Custom Matchers\n\nYou can write your own custom RSpec matchers. Custom matchers can help you write more understandable\nspecs.\n\nCustom matchers configuration how-to and examples:\n- [spec\u002Fsupport\u002Fmatchers.rb](spec\u002Fsupport\u002Fmatchers.rb)\n- [spec\u002Fmatchers](spec\u002Fmatchers)\n- [spec\u002Fmatchers\u002Fbe_pending_subscription_page.rb](spec\u002Fmatchers\u002Fbe_pending_subscription_page.rb)\n- Chainable matcher: [spec\u002Fmatchers\u002Fbe_confirm_subscription_page.rb](spec\u002Fmatchers\u002Fbe_confirm_subscription_page.rb)\n- [spec\u002Fmatchers\u002Fhave_error_messages.rb](spec\u002Fmatchers\u002Fhave_error_messages.rb)\n- [spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb](spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb)\n- Lightweight matcher with `satisfy`: [spec\u002Fapi\u002Fv1\u002Ftoken_spec.rb](spec\u002Fapi\u002Fv1\u002Ftoken_spec.rb)\n\n\n# RSpec-Expectations Docs\n- [RSpec-Expectations API](http:\u002F\u002Fwww.rubydoc.info\u002Fgems\u002Frspec-expectations\u002Fframes)\n- [RSpec-Expectations matchers](https:\u002F\u002Fwww.relishapp.com\u002Frspec\u002Frspec-expectations\u002Fdocs\u002Fbuilt-in-matchers)\n- [Expectations matchers cheatsheet](https:\u002F\u002Fgist.github.com\u002Fhpjaj\u002Fef5ba70a938a963332d0)\n\n\n# RSpec-Mocks Specs & Docs\n- [spec\u002Fcontrollers\u002Fsubscriptions_controller_spec.rb](spec\u002Fcontrollers\u002Fsubscriptions_controller_spec.rb)\n- [spec\u002Fmailers\u002Fsubscription_mailer_spec.rb](spec\u002Fmailers\u002Fsubscription_mailer_spec.rb)\n- [spec\u002Fmodels\u002Fsubscription_spec.rb](spec\u002Fmodels\u002Fsubscription_spec.rb)\n- [RSpec Mocks API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-mocks\u002Fdocs)\n\n# RSpec-Rails\nSee [RSpec Rails](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs) for installation instructions.\n\n## Matchers\n- https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Fmatchers\n\n## Generators\n- https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Fgenerators\n\n## Feature Specs & Docs\n- [spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb](spec\u002Ffeatures\u002Fsubscribe_to_newsletter_spec.rb)\n- [Feature specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Ffeature-specs\u002Ffeature-spec)\n\n## API Request Specs, Docs, & Helpers\n- [spec\u002Fapi\u002Fv1\u002Ftoken_spec.rb](spec\u002Fapi\u002Fv1\u002Ftoken_spec.rb)\n- [spec\u002Fsupport\u002Fjson_helper.rb](spec\u002Fsupport\u002Fjson_helper.rb)\n- [spec\u002Fsupport\u002Ferror_responses.rb](spec\u002Fsupport\u002Ferror_responses.rb)\n- [Request specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Frequest-specs\u002Frequest-spec)\n\n## Mailer Specs & Docs\n- [spec\u002Fmailers\u002Fsubscription_mailer_spec.rb](spec\u002Fmailers\u002Fsubscription_mailer_spec.rb)\n- [Mailer specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Fmailer-specs\u002Furl-helpers-in-mailer-examples)\n\n## Controller Specs & Docs\n- [spec\u002Fcontrollers\u002Fsubscriptions_controller_spec.rb](spec\u002Fcontrollers\u002Fsubscriptions_controller_spec.rb)\n- [Controller specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Fcontroller-specs)\n- [Controller specs cheatsheet](https:\u002F\u002Fgist.github.com\u002Feliotsykes\u002F5b71277b0813fbc0df56)\n\n## View Specs & Docs\n- [The Big List of View Specs](https:\u002F\u002Feliotsykes.com\u002Fview-specs)\n- [View specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Fview-specs)\n\n## Helper Specs & Docs\n- [spec\u002Fhelpers\u002Fapplication_helper_spec.rb](spec\u002Fhelpers\u002Fapplication_helper_spec.rb)\n- [Helper specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Fhelper-specs\u002Fhelper-spec)\n\n## Routing Specs & Docs\n- [spec\u002Frouting\u002Fsubscriptions_routing_spec.rb](spec\u002Frouting\u002Fsubscriptions_routing_spec.rb)\n- [Routing specs API](https:\u002F\u002Frelishapp.com\u002Frspec\u002Frspec-rails\u002Fdocs\u002Frouting-specs)\n\n\n# Validator Specs\n\nTo test a custom validator you've written, refer to these validator specs from other Rails projects. These specs each follow a similar pattern where the validator is tested with a dummy model that is defined and used within the spec only. Using a dummy model is usually preferable to writing a validator spec that is dependent on a real model.\n\n- [blacklist_validator_spec.rb](https:\u002F\u002Fgithub.com\u002Fcalagator\u002Fcalagator\u002Fblob\u002Fb5fb7098fb94627b9791a0e40686be4d80c9c0c9\u002Fspec\u002Flib\u002Fcalagator\u002Fblacklist_validator_spec.rb) from Calagator\n- [quality_title_validator_spec.rb](https:\u002F\u002Fgithub.com\u002Fdiscourse\u002Fdiscourse\u002Fblob\u002F00342faff9593a78d4c27c774ff75e1dd8819f34\u002Fspec\u002Fcomponents\u002Fvalidators\u002Fquality_title_validator_spec.rb) from Discourse\n- [phone_number_validator_spec.rb](https:\u002F\u002Fgithub.com\u002Fnetguru\u002Fpeople\u002Fblob\u002F410c8f9355b7295af9711aeade8210a1a97e0a0c\u002Fspec\u002Fvalidators\u002Fphone_number_validator_spec.rb) from Netguru-People\n- [no_empty_spaces_validator_spec.rb](https:\u002F\u002Fgithub.com\u002Fdanbartlett\u002Fopensit\u002Fblob\u002F9d434bc6157b470c479f44c87c945c4652d37db1\u002Fspec\u002Fvalidators\u002Fno_empty_spaces_validator_spec.rb) from OpenSit\n\nRelated task: [Demonstrate Validator Specs within rspec-rails-examples](https:\u002F\u002Fgithub.com\u002Feliotsykes\u002Frspec-rails-examples\u002Fissues\u002F106)\n\n\n# Enable Spring for RSpec\n\n[Spring](https:\u002F\u002Fgithub.com\u002Frails\u002Fspring) is a Rails application preloader. It speeds up development by keeping your application running in the background so you don't need to boot it every time you run a new command.\n\nTo take advantage of this boost when you run `bin\u002Frspec`, the `spring-commands-rspec` gem needs to be installed and a new `rspec` binstub needs to be created:\n\n```bash\n# 1. Add `spring-commands-rspec` to Gemfile in development and test groups and\n#    install gem:\nbundle install\n\n# 2. Spring-ify the `bin\u002Frspec` binstub:\nbundle exec spring binstub rspec\n\n# 3. Stop spring to ensure the changes are picked up:\nbin\u002Fspring stop\n\n# 4. Check bin\u002Frspec is still working:\nbin\u002Frspec\n```\n\nSee the spring-commands-rspec README for up-to-date installation instructions:\nhttps:\u002F\u002Fgithub.com\u002Fjonleighton\u002Fspring-commands-rspec\n\n\n# Automated Continuous Integration with Travis CI\n\nContinuous Integration (CI) is the practice of integrating new code into the master branch frequently, to help detect merge conflicts, bugs, and improve the quality of the software a development team writes.\n\nCI is usually accompanied by running an application's test suite against the latest code changes, and flagging any test failures that are found. Developers are expected to investigate and fix these failures to maintain a passing test suite and therefore quality.\n\n[Travis CI](https:\u002F\u002Ftravis-ci.org) is a build server that helps automate the CI process. Travis CI runs an application's tests against the latest changes pushed to the application's code respository. In this project, Travis CI runs the project's tests (`rake test`) on pull requests and on changes to the master branch.\n\nTravis CI configuration how-to and example:\n- [.travis.yml](.travis.yml) - Travis CI's configuration file (with instructions)\n- [Our Travis CI build!](https:\u002F\u002Ftravis-ci.org\u002Feliotsykes\u002Frspec-rails-examples)\n- Our Travis CI badge (hopefully its green): [![Build Status](https:\u002F\u002Ftravis-ci.org\u002Feliotsykes\u002Frspec-rails-examples.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Feliotsykes\u002Frspec-rails-examples)\n\n---\n\n# Contributors\n\n- Eliot Sykes https:\u002F\u002Feliotsykes.com\u002F\n- Vitaly Tatarintsev https:\u002F\u002Fgithub.com\u002Fck3g\n- Ryan Wold https:\u002F\u002Fafomi.com\u002F\n- Andy Waite http:\u002F\u002Fblog.andywaite.com\u002F\n- Alex Birdsall https:\u002F\u002Fgithub.com\u002Fambirdsall\n- Lee Smith https:\u002F\u002Fgithub.com\u002Fleesmith\n- Abdullah Alger http:\u002F\u002Fwww.abdullahalger.com\u002F\n- Your name here, contributions are welcome and easy, just fork the GitHub repo, make your changes, then submit your pull request! Please ask if you'd like some help.\n","该项目是一个基于Rails应用的RSpec速查表，旨在帮助开发者从一个模型代码库中学习如何专业地测试Rails应用程序。核心功能包括提供详尽的RSpec示例和相关文档，涵盖feature、mailer、model等多种类型的spec测试，并且深入讲解了如何配置如DatabaseCleaner、Capybara等流行测试工具。技术特点上，项目使用Ruby语言编写，支持多种测试场景，适合正在学习或希望提高RSpec测试技能的Rails开发者使用。无论是初学者还是有经验的开发者都能从中受益，快速提升自己在Rails应用中的测试能力。",2,"2026-06-11 03:15:44","top_language"]