Last active
February 22, 2017 10:44
-
-
Save edlvj/0ad26a6433cb56cfc4636eabafe2a2d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
F | |
Failures: | |
1) Header check items on | |
Failure/Error: visit root_path | |
NameError: | |
undefined local variable or method `root_path' for #<RSpec::ExampleGroups::Header:0x00000003626508> | |
# ./spec/features/header_spec.rb:6:in `block (2 levels) in <top (required)>' | |
Finished in 0.00144 seconds (files took 0.74115 seconds to load) | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/features/header_spec.rb:4 # Header check items on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'capybara/rspec' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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__) | |
# Prevent database truncation if the environment is production | |
abort("The Rails environment is running in production mode!") if Rails.env.production? | |
require 'rspec/rails' | |
require 'capybara/rspec' | |
require 'capybara/rails' | |
# 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 | |
# 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`. | |
# | |
# The following line is provided for convenience purposes. It has the downside | |
# of increasing the boot-up time by auto-requiring all files in the support | |
# 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 } | |
# Checks for pending migration and applies them 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! | |
# Filter lines from Rails gems in backtraces. | |
config.filter_rails_from_backtrace! | |
# arbitrary gems may also be filtered via: | |
# config.filter_gems_from_backtrace("gem name") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/workspace (master) $ rails routes | |
Prefix Verb URI Pattern Controller#Action | |
new_admin_user_session GET /admin/login(.:format) active_admin/devise/sessions#new | |
admin_user_session POST /admin/login(.:format) active_admin/devise/sessions#create | |
destroy_admin_user_session DELETE|GET /admin/logout(.:format) active_admin/devise/sessions#destroy | |
new_admin_user_password GET /admin/password/new(.:format) active_admin/devise/passwords#new | |
edit_admin_user_password GET /admin/password/edit(.:format) active_admin/devise/passwords#edit | |
admin_user_password PATCH /admin/password(.:format) active_admin/devise/passwords#update | |
PUT /admin/password(.:format) active_admin/devise/passwords#update | |
POST /admin/password(.:format) active_admin/devise/passwords#create | |
admin_root GET /admin(.:format) admin/dashboard#index | |
batch_action_admin_authors POST /admin/authors/batch_action(.:format) admin/authors#batch_action | |
admin_authors GET /admin/authors(.:format) admin/authors#index | |
POST /admin/authors(.:format) admin/authors#create | |
new_admin_author GET /admin/authors/new(.:format) admin/authors#new | |
edit_admin_author GET /admin/authors/:id/edit(.:format) admin/authors#edit | |
admin_author GET /admin/authors/:id(.:format) admin/authors#show | |
PATCH /admin/authors/:id(.:format) admin/authors#update | |
PUT /admin/authors/:id(.:format) admin/authors#update | |
DELETE /admin/authors/:id(.:format) admin/authors#destroy | |
batch_action_admin_categories POST /admin/categories/batch_action(.:format) admin/categories#batch_action | |
admin_categories GET /admin/categories(.:format) admin/categories#index | |
POST /admin/categories(.:format) admin/categories#create | |
new_admin_category GET /admin/categories/new(.:format) admin/categories#new | |
edit_admin_category GET /admin/categories/:id/edit(.:format) admin/categories#edit | |
admin_category GET /admin/categories/:id(.:format) admin/categories#show | |
PATCH /admin/categories/:id(.:format) admin/categories#update | |
PUT /admin/categories/:id(.:format) admin/categories#update | |
DELETE /admin/categories/:id(.:format) admin/categories#destroy | |
admin_dashboard GET /admin/dashboard(.:format) admin/dashboard#index | |
batch_action_admin_users POST /admin/users/batch_action(.:format) admin/users#batch_action | |
admin_users GET /admin/users(.:format) admin/users#index | |
admin_user GET /admin/users/:id(.:format) admin/users#show | |
batch_action_admin_books POST /admin/books/batch_action(.:format) admin/books#batch_action | |
admin_books GET /admin/books(.:format) admin/books#index | |
POST /admin/books(.:format) admin/books#create | |
new_admin_book GET /admin/books/new(.:format) admin/books#new | |
edit_admin_book GET /admin/books/:id/edit(.:format) admin/books#edit | |
admin_book GET /admin/books/:id(.:format) admin/books#show | |
PATCH /admin/books/:id(.:format) admin/books#update | |
PUT /admin/books/:id(.:format) admin/books#update | |
DELETE /admin/books/:id(.:format) admin/books#destroy | |
batch_action_admin_reviews POST /admin/reviews/batch_action(.:format) admin/reviews#batch_action | |
admin_reviews GET /admin/reviews(.:format) admin/reviews#index | |
admin_review GET /admin/reviews/:id(.:format) admin/reviews#show | |
batch_action_admin_admin_users POST /admin/admin_users/batch_action(.:format) admin/admin_users#batch_action | |
admin_admin_users GET /admin/admin_users(.:format) admin/admin_users#index | |
POST /admin/admin_users(.:format) admin/admin_users#create | |
new_admin_admin_user GET /admin/admin_users/new(.:format) admin/admin_users#new | |
edit_admin_admin_user GET /admin/admin_users/:id/edit(.:format) admin/admin_users#edit | |
admin_admin_user GET /admin/admin_users/:id(.:format) admin/admin_users#show | |
PATCH /admin/admin_users/:id(.:format) admin/admin_users#update | |
PUT /admin/admin_users/:id(.:format) admin/admin_users#update | |
DELETE /admin/admin_users/:id(.:format) admin/admin_users#destroy | |
admin_comments GET /admin/comments(.:format) admin/comments#index | |
POST /admin/comments(.:format) admin/comments#create | |
admin_comment GET /admin/comments/:id(.:format) admin/comments#show | |
DELETE /admin/comments/:id(.:format) admin/comments#destroy | |
user_facebook_omniauth_authorize GET|POST /users/auth/facebook(.:format) users/omniauth_callbacks#passthru | |
user_facebook_omniauth_callback GET|POST /users/auth/facebook/callback(.:format) users/omniauth_callbacks#facebook | |
new_user_session GET /users/sign_in(.:format) users/sessions#new | |
user_session POST /users/sign_in(.:format) users/sessions#create | |
destroy_user_session DELETE /users/sign_out(.:format) users/sessions#destroy | |
new_user_password GET /users/password/new(.:format) users/passwords#new | |
edit_user_password GET /users/password/edit(.:format) users/passwords#edit | |
user_password PATCH /users/password(.:format) users/passwords#update | |
PUT /users/password(.:format) users/passwords#update | |
POST /users/password(.:format) users/passwords#create | |
cancel_user_registration GET /users/cancel(.:format) users/registrations#cancel | |
new_user_registration GET /users/sign_up(.:format) users/registrations#new | |
edit_user_registration GET /users/edit(.:format) users/registrations#edit | |
user_registration PATCH /users(.:format) users/registrations#update | |
PUT /users(.:format) users/registrations#update | |
DELETE /users(.:format) users/registrations#destroy | |
POST /users(.:format) users/registrations#create | |
checkout_login GET /users/checkout_login(.:format) users/sessions#checkout_login | |
email_signin POST /users/email_sign_in(.:format) users/registrations#email | |
user_setting GET /users/settings(.:format) setting#index | |
users_update PUT /users/update(.:format) setting#update | |
store_index GET /store(.:format) store#index | |
store GET /store/:id(.:format) store#show | |
order_checkout_index GET /orders/:order_id/checkout(.:format) checkout#index | |
order_checkout GET /orders/:order_id/checkout/:id(.:format) checkout#show | |
PATCH /orders/:order_id/checkout/:id(.:format) checkout#update | |
PUT /orders/:order_id/checkout/:id(.:format) checkout#update | |
orders GET /orders(.:format) orders#index | |
order GET /orders/:id(.:format) orders#show | |
PATCH /orders/:id(.:format) orders#update | |
PUT /orders/:id(.:format) orders#update | |
book_ratings POST /books/:book_id/ratings(.:format) ratings#create | |
new_book_rating GET /books/:book_id/ratings/new(.:format) ratings#new | |
books GET /books(.:format) books#index | |
book GET /books/:id(.:format) books#show | |
checkout_cart POST /cart/checkout(.:format) carts#checkout | |
add_to_cart POST /cart/:id(.:format) carts#add | |
cart GET /cart(.:format) carts#show | |
PATCH /cart(.:format) carts#update | |
PUT /cart(.:format) carts#update | |
DELETE /cart(.:format) carts#destroy | |
root GET / store#index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
devise_for :admin_users, ActiveAdmin::Devise.config | |
ActiveAdmin.routes(self) | |
devise_for :users, controllers: { sessions: 'users/sessions', registrations: 'users/registrations', passwords: 'users/passwords', omniauth_callbacks: "users/omniauth_callbacks" } | |
devise_scope :user do | |
get 'users/checkout_login', to: 'users/sessions#checkout_login', as: :checkout_login | |
post 'users/email_sign_in', to: 'users/registrations#email', as: :email_signin | |
get 'users/settings', to: 'setting#index', as: :user_setting | |
put 'users/update', to: 'setting#update' | |
end | |
resources :store, only: [:index, :show] | |
resources :orders, only: [:index, :show, :update] do | |
resources :checkout, only: [:index, :show, :update] | |
end | |
resources :books, only: [:show, :index] do | |
resources :ratings, only: [:new, :create] | |
end | |
resource :cart, only: [:show, :destroy, :update] do | |
member do | |
post :checkout | |
post ':id' => 'carts#add', as: :add_to | |
end | |
end | |
root to: 'store#index' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'features/features_spec_helper' | |
feature "Header" do | |
scenario "check items on" do | |
visit root_path | |
it 'contains name of shop' do | |
expect(page.first('.navbar-brand').text).not_to eq("") | |
end | |
it 'contains sharing menu items' do | |
expect(page).to have_content I18n.t('navigation.home') | |
expect(page).to have_content I18n.t('navigation.shop') | |
end | |
it 'not logged user' do | |
expect(page).to have_content I18n.t('navigation.log_in') | |
expect(page).to have_content I18n.t('navigation.sign_up') | |
expect(page).not_to have_content I18n.t('navigation.account') | |
end | |
it 'logged user' do | |
#expect(page).to have_content I18n.t('navigation.account') | |
#expect(page).to have_content I18n.t('navigation.sign_out') | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, 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 `.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| | |
# 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| | |
# 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" | |
# ...rather than: | |
# # => "be bigger than 2" | |
expectations.include_chain_clauses_in_custom_matcher_descriptions = true | |
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| | |
# Prevents you from mocking or stubbing a method that does not exist on | |
# a real object. This is generally recommended, and will default to | |
# `true` in RSpec 4. | |
mocks.verify_partial_doubles = true | |
end | |
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will | |
# have no way to turn it off -- the option exists only for backwards | |
# compatibility in RSpec 3). It causes shared context metadata to be | |
# inherited by the metadata hash of host groups and examples, rather than | |
# triggering implicit auto-inclusion in groups with matching metadata. | |
config.shared_context_metadata_behavior = :apply_to_host_groups | |
# The settings below are suggested to provide a good initial experience | |
# with RSpec, but feel free to customize to your heart's content. | |
=begin | |
# This allows 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. RSpec also provides | |
# aliases for `it`, `describe`, and `context` that include `:focus` | |
# metadata: `fit`, `fdescribe` and `fcontext`, respectively. | |
config.filter_run_when_matching :focus | |
# 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://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ | |
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ | |
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode | |
config.disable_monkey_patching! | |
# 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 | |
# 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 | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment