Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerate rspec helper files #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore rspec examples file
/spec/examples.txt

# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
Expand Down
2 changes: 1 addition & 1 deletion spec/features/home_page_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

feature "Home page" do
RSpec.describe "Home page" do

scenario "visit" do
visit "/"
Expand Down
2 changes: 1 addition & 1 deletion spec/features/share_page_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

feature "Share page", js: true do
RSpec.describe "Share page", js: true do

scenario "displays 3rd party widgets" do
visit "/share"
Expand Down
2 changes: 1 addition & 1 deletion spec/features/subscribe_to_newsletter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

feature "Subscribe to newsletter" do
RSpec.describe "Subscribe to newsletter" do

context "in browser with native date input", driver: driver_with(native_date_input: true) do

Expand Down
6 changes: 3 additions & 3 deletions spec/features/user_login_and_logout_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

feature "User logs in and logs out" do
RSpec.describe "User logs in and logs out" do

# `js: true` spec metadata means this will run using the `:selenium`
# browser driver configured in spec/support/capybara.rb
Expand Down Expand Up @@ -51,8 +51,8 @@

login email, "1st-try-wrong-password"
expect(page).to have_content "Invalid email or password"
login email, "2nd-try-wrong-password"

login email, "2nd-try-wrong-password"
expect(page).to have_content "You have one more attempt before your account is locked"

login email, "3rd-try-wrong-password"
Expand Down
4 changes: 2 additions & 2 deletions spec/features/user_registers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

feature "User registers" do
RSpec.describe "User registers" do

scenario "with valid details" do

Expand Down Expand Up @@ -85,7 +85,7 @@
end

scenario "too short password" do

min_password_length = 8
too_short_password = "p" * (min_password_length - 1)
fill_in "Email", with: "someone@example.tld"
Expand Down
17 changes: 9 additions & 8 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'

# DO NOT Add additional requires below this line. Rails is not loaded until this point!
# INSTEAD...put requires in dedicated files in spec/support so that folks browsing this
# can see all the config for a testing gem in one easy-to-find, well-named file.
# Add additional requires below this line. Rails is not loaded until this point!

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
Expand All @@ -21,7 +20,7 @@
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
Expand All @@ -31,7 +30,9 @@
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"

# See database_cleaner.rb about config.use_transactional_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

# RSpec Rails can automatically mix in different behaviours to your tests
Expand Down
54 changes: 30 additions & 24 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause this
# file to always be loaded, without a need to explicitly require it in any files.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# files.
#
# Given that it is always loaded, you are encouraged to keep this file as
# light-weight as possible. Requiring heavyweight dependencies from this file
# will add to the boot time of your test suite on EVERY test run, even for an
# individual file that may not need all of that loaded. Instead, consider making
# a separate helper file that requires the additional dependencies and performs
# the additional setup, and require it from the spec files that actually need it.
# the additional setup, and require it from the spec files that actually need
# it.
#
# The `.rspec` file also contains a few flags that are not defaults but that
# users commonly want.
Expand All @@ -22,10 +24,10 @@
# This option will default to `true` in RSpec 4. It makes the `description`
# and `failure_message` of custom matchers include text for helper methods
# defined using `chain`, e.g.:
# be_bigger_than(2).and_smaller_than(4).description
# # => "be bigger than 2 and smaller than 4"
# be_bigger_than(2).and_smaller_than(4).description
# # => "be bigger than 2 and smaller than 4"
# ...rather than:
# # => "be bigger than 2"
# # => "be bigger than 2"
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end

Expand All @@ -38,32 +40,25 @@
mocks.verify_partial_doubles = true
end

# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random

# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed

# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin

# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
config.filter_run :focus
config.run_all_when_everything_filtered = true

# Limits the available syntax to the non-monkey patched syntax that is recommended.
# For more details, see:
# Allows RSpec to persist some state between runs in order to support
# the `--only-failures` and `--next-failure` CLI options. We recommend
# you configure your source control system to ignore this file.
config.example_status_persistence_file_path = "spec/examples.txt"

# Limits the available syntax to the non-monkey patched syntax that is
# recommended. For more details, see:
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
config.disable_monkey_patching!

Expand All @@ -80,7 +75,18 @@
# Print the 10 slowest examples and example groups at the
# end of the spec run, to help surface which specs are running
# particularly slow.
config.profile_examples = 10
# config.profile_examples = 10

# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = :random

# Seed global randomization in this process using the `--seed` CLI option.
# Setting this allows you to use `--seed` to deterministically reproduce
# test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure.
Kernel.srand config.seed

=end
end