Skip to content

Commit

Permalink
Adds focus funtionality in spec helper for rspec and two pending stud…
Browse files Browse the repository at this point in the history
…ent_profile_controller tests
  • Loading branch information
charlieperson committed Apr 9, 2016
1 parent d3a813f commit 1e56328
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
devise_for :students
resources :student_profiles


root "static_pages#home"

get "dashboard" => "dashboard#index"
Expand Down
22 changes: 12 additions & 10 deletions spec/controllers/student_profiles_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
require 'rails_helper'

RSpec.describe StudentProfilesController, type: :controller do
describe StudentProfilesController do
describe 'GET new' do
xit 'assigns @student_profile' do
student_profile = StudentProfile.new
get :new
expect(assigns(:student_profile)).to be_a_new(StudentProfile)
get '/student_profiles/new'
binding.pry
end
end
describe 'update' do
xit 'updates student profile' do
profile = create(:student_profile)
put "/student_profiles/#{profile.id}", {name: 'new name', native_language: 'Spanish'}
profile = StudentProfile.find(1)
expect(profile.name).to eq('new name')
expect(profile.native_language).to eq('Spanish')
end
before { get :new }
xit { should render_template('new') }
end


describe 'POST create' do
# it 'creates and saves a new profile' do
# expect{
# post :create, student_profile: FactoryGirl.attributes_for(:student_profile)
Expand All @@ -25,7 +28,6 @@
# post :create, profile.id
# expect(subject.current_student.student_profile).to eq(profile)
# end
end

describe 'GET show' do
xit 'renders the show template' do
Expand Down
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@
mocks.verify_partial_doubles = true
end

# config.filter_run :focus

# 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
# Allows RSpec to persist some state between runs in order to support
Expand Down

0 comments on commit 1e56328

Please sign in to comment.