Call mock_model with the class name instead of a string

This commit is contained in:
Thibault Jouan 2011-09-20 23:27:48 +00:00
parent abb7b07c89
commit 72f800397d
6 changed files with 7 additions and 7 deletions

View File

@ -3,10 +3,10 @@ require 'spec_helper'
describe 'home/index.html.haml' do describe 'home/index.html.haml' do
before do before do
assign :playlists, [ assign :playlists, [
mock_model('Playlist', :name => 'Electro') mock_model(Playlist, :name => 'Electro')
] ]
assign :tracks, [ assign :tracks, [
mock_model('Track', :name => 'Mega song') mock_model(Track, :name => 'Mega song')
] ]
end end

View File

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'playlists/edit.html.haml' do describe 'playlists/edit.html.haml' do
let(:playlist) do let(:playlist) do
mock_model('Playlist').as_new_record.as_null_object mock_model(Playlist).as_new_record.as_null_object
end end
before do before do

View File

@ -3,7 +3,7 @@ require 'spec_helper'
describe 'playlists/index.html.haml' do describe 'playlists/index.html.haml' do
before do before do
assign :playlists, [ assign :playlists, [
mock_model('Playlist', :name => 'Electro') mock_model(Playlist, :name => 'Electro')
] ]
end end

View File

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'playlists/new.html.haml' do describe 'playlists/new.html.haml' do
let(:playlist) do let(:playlist) do
mock_model('Playlist').as_new_record.as_null_object mock_model(Playlist).as_new_record.as_null_object
end end
before do before do

View File

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'tracks/new.html.haml' do describe 'tracks/new.html.haml' do
let(:track) do let(:track) do
mock_model('Track').as_new_record.as_null_object mock_model(Track).as_new_record.as_null_object
end end
before do before do

View File

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'users/new.html.haml' do describe 'users/new.html.haml' do
let(:user) do let(:user) do
mock_model('User').as_new_record.as_null_object mock_model(User).as_new_record.as_null_object
end end
before do before do