Organize feature specs in sub directories

This commit is contained in:
Thibault Jouan
2015-05-01 11:18:41 +00:00
parent 10d4da2822
commit 737c6b03e4
5 changed files with 16 additions and 11 deletions

View File

@@ -0,0 +1,25 @@
feature 'Tracks CRUD' do
include UserIntegrationHelpers
background { sign_in }
scenario 'shows track' do
track = FactoryGirl.create(:track, name: 'Mega song')
visit track_path(track)
expect(page).to have_content 'Mega song'
end
scenario 'creates track' do
visit root_path
click_link 'Add a track'
fill_in 'Name', with: 'Mega song'
attach_file 'File', File.expand_path('spec/fixtures/test.mp3')
click_button 'Upload'
expect(current_path).to eq track_path Track.first
expect(page).to have_content 'Mega song'
end
end

View File

@@ -0,0 +1,14 @@
feature 'Tracks player' do
include UserIntegrationHelpers
background { sign_in }
scenario 'includes a player in track page' do
track = FactoryGirl.create(:track_with_sound)
visit track_path(track)
expect(page).to have_xpath "//audio[@src='#{sound_path track.sound}']"
visit find('audio')[:src]
end
end