После переноса на Rails 3 некоторые тесты RSpec прерваны
Пример:
Контроллер:
class ProfilesController < ApplicationController
def create
@profile = Profile.new(params[:note])
respond_to do |format|
if @profile.save
format.html { redirect_to :back }
else
format.html { render :new }
format.js do
render(:update) do |page|
page.flash.show @profile.errors.full_messages.join(', ')
end
end
end
end
end
end
Spec:
require 'spec_helper'
describe ProfilesController do
before(:each) { sign_in mock_model(Account).as_null_object }
context 'POST create' do
it 'is accessible for logged in user' do
controller.should_receive(:create)
post :create
end
end
end
Ошибка:
19) ProfilesController POST create is accessible for logged in user
Failure/Error: post :create
ActionView::MissingTemplate:
Missing template profiles/create with {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rjs, :rhtml, :rxml, :builder, :erb]} in view paths "#<RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x1059d48f0>"
# ./spec/controllers/profiles_controller_spec.rb:48