diff --git a/config/routes.rb b/config/routes.rb index f8cd320..9ac8a8f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,6 @@ devise_for :students resources :student_profiles - root "static_pages#home" get "dashboard" => "dashboard#index" diff --git a/spec/controllers/student_profiles_controller_spec.rb b/spec/controllers/student_profiles_controller_spec.rb index 9b3bbaf..079e012 100644 --- a/spec/controllers/student_profiles_controller_spec.rb +++ b/spec/controllers/student_profiles_controller_spec.rb @@ -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) @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1730bf2..d91db08 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -49,6 +49,8 @@ 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 @@ -56,7 +58,6 @@ # 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