Skip to content

Commit

Permalink
update spec format
Browse files Browse the repository at this point in the history
  • Loading branch information
filialpails committed Jul 25, 2014
1 parent 18124eb commit 16a3c09
Show file tree
Hide file tree
Showing 15 changed files with 126 additions and 115 deletions.
4 changes: 2 additions & 2 deletions spec/controllers/address_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'
require 'rails_helper'

describe AddressController do
RSpec.describe AddressController, :type => :controller do

describe "GET 'show'" do
it "returns http success" do
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/ram_map_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'
require 'rails_helper'

describe RamMapController do
RSpec.describe RamMapController, :type => :controller do

describe "GET 'show'" do
it "returns http success" do
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/rom_info_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'
require 'rails_helper'

describe RomInfoController do
RSpec.describe RomInfoController, :type => :controller do

describe "GET 'show'" do
it "returns http success" do
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/rom_map_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'
require 'rails_helper'

describe RomMapController do
RSpec.describe RomMapController, :type => :controller do

describe "GET 'show'" do
it "returns http success" do
Expand Down
15 changes: 0 additions & 15 deletions spec/helpers/address_helper_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/helpers/ram_map_helper_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/helpers/rom_info_helper_spec.rb

This file was deleted.

15 changes: 0 additions & 15 deletions spec/helpers/rom_map_helper_spec.rb

This file was deleted.

5 changes: 0 additions & 5 deletions spec/models/rom_entry_spec.rb

This file was deleted.

43 changes: 43 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
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.
#ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
#config.fixture_path = "#{::Rails.root}/spec/fixtures"

# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
#config.use_transactional_fixtures = true

# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and
# `post` in specs under `spec/controllers`.
#
# You can disable this behaviour by removing the line below, and instead
# explicitly tag your specs with their type, e.g.:
#
# RSpec.describe UsersController, :type => :controller do
# # ...
# end
#
# The different available types are documented in the features, such as in
# https://relishapp.com/rspec/rspec-rails/docs
config.infer_spec_type_from_file_location!
end
101 changes: 67 additions & 34 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,43 +1,76 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

# 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.
#
# 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, make a
# separate helper file that requires this one and then use it only in the specs
# that actually need it.
#
# The `.rspec` file also contains a few flags that are not defaults but that
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
# 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

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
# individual spec file.
if config.files_to_run.one?
# Use the documentation formatter for detailed output,
# unless a formatter has already been configured
# (e.g. via a command-line flag).
config.default_formatter = 'doc'
end

# 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

# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = true
# 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

# 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"
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

# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# Enable only the newer, non-monkey-patching expect syntax.
# For more details, see:
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
expectations.syntax = :expect
end

# rspec-mocks config goes here. You can use an alternate test double
# library (such as bogus or mocha) by changing the `mock_with` option here.
config.mock_with :rspec do |mocks|
# Enable only the newer, non-monkey-patching expect syntax.
# For more details, see:
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
mocks.syntax = :expect

# Prevents you from mocking or stubbing a method that does not exist on
# a real object. This is generally recommended.
mocks.verify_partial_doubles = true
end
end
4 changes: 2 additions & 2 deletions spec/views/address/show.html.slim_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'
require 'rails_helper'

describe "address/show.html.slim" do
RSpec.describe "address/show.html.slim", :type => :view do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 2 additions & 2 deletions spec/views/ram_map/show.html.slim_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'
require 'rails_helper'

describe "ram_map/show.html.slim" do
RSpec.describe "ram_map/show.html.slim", :type => :view do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 2 additions & 2 deletions spec/views/rom_info/show.html.slim_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'
require 'rails_helper'

describe "rom_info/show.html.slim" do
RSpec.describe "rom_info/show.html.slim", :type => :view do
pending "add some examples to (or delete) #{__FILE__}"
end
4 changes: 2 additions & 2 deletions spec/views/rom_map/show.html.slim_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'
require 'rails_helper'

describe "rom_map/show.html.slim" do
RSpec.describe "rom_map/show.html.slim", :type => :view do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit 16a3c09

Please sign in to comment.