Update factory girl to last version

This commit is contained in:
Thibault Jouan
2014-04-01 05:04:27 +00:00
parent d2b332215e
commit eda2f3fbee
28 changed files with 56 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
require 'spec_helper'
feature 'API sign in' do
let(:user) { Factory.create(:user) }
let(:user) { FactoryGirl.create(:user) }
def do_create
post api_sessions_path, :format => :json, :session => {

View File

@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'API cross origin request' do
include UserIntegrationHelpers
let(:user) { Factory.create(:user) }
let(:user) { FactoryGirl.create(:user) }
let(:origin) { 'http://origin.example/' }
background do

View File

@@ -8,7 +8,7 @@ feature 'API playlists' do
end
scenario 'creates playlist' do
playlist = Factory.attributes_for :playlist
playlist = FactoryGirl.attributes_for :playlist
post api_playlists_path,
:format => :json,

View File

@@ -8,8 +8,8 @@ feature 'API tracks' do
end
scenario 'lists tracks' do
track_1 = Factory.create(:track_with_sound, :name => 'Track 1')
track_2 = Factory.create(:track, :name => 'Track 2')
track_1 = FactoryGirl.create(:track_with_sound, :name => 'Track 1')
track_2 = FactoryGirl.create(:track, :name => 'Track 2')
get api_tracks_path, :format => :json

View File

@@ -8,7 +8,7 @@ feature 'Home page' do
end
scenario 'displays playlists' do
playlist = Factory.create(:playlist, :name => 'Electro')
playlist = FactoryGirl.create(:playlist, :name => 'Electro')
visit root_path
@@ -16,11 +16,11 @@ feature 'Home page' do
end
scenario 'displays last track added' do
Factory.create(:track,
FactoryGirl.create(:track,
:name => 'Mega song 1',
:created_at => '2011-07-27 19:13:42'
)
Factory.create(:track,
FactoryGirl.create(:track,
:name => 'Mega song 2',
:created_at => '2011-07-27 19:58:57'
)

View File

@@ -8,8 +8,8 @@ feature 'Playlists' do
end
scenario 'lists playlists' do
Factory.create(:playlist, :name => 'Electro')
Factory.create(:playlist, :name => 'Reggae')
FactoryGirl.create(:playlist, :name => 'Electro')
FactoryGirl.create(:playlist, :name => 'Reggae')
visit playlists_path
@@ -28,7 +28,7 @@ feature 'Playlists' do
end
scenario 'edits playlist' do
Factory.create(:playlist, :name => 'Electro')
FactoryGirl.create(:playlist, :name => 'Electro')
visit playlists_path
click_link 'Electro'

View File

@@ -8,7 +8,7 @@ feature 'Tracks' do
end
scenario 'shows track' do
track = Factory.create(:track, :name => 'Mega song')
track = FactoryGirl.create(:track, :name => 'Mega song')
visit track_path(track)
@@ -28,7 +28,7 @@ feature 'Tracks' do
end
scenario 'plays track' do
track = Factory.create(:track_with_sound)
track = FactoryGirl.create(:track_with_sound)
visit track_path(track)

View File

@@ -8,7 +8,7 @@ feature 'User sign in' do
end
scenario 'signs the user in' do
user = Factory.create(:user)
user = FactoryGirl.create(:user)
visit new_session_path
fill_in 'Email', :with => user.email

View File

@@ -1,7 +1,7 @@
require 'spec_helper'
feature 'User sign up' do
let(:user) { Factory.build(:user) }
let(:user) { FactoryGirl.build(:user) }
background do
visit new_user_path