Created
December 14, 2011 20:58
-
-
Save mrnugget/1478496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe SessionsController do | |
render_views | |
# | |
# | |
# | |
describe "GET 'new'" do | |
it "should be successful" do | |
get :new | |
response.should be_success | |
end | |
it "should have the right title" do | |
get :new | |
response.should have_selector("title", :content => "Add session") | |
end | |
it "should show files in fixtures/archive" do | |
test_session = "2011.08.18" | |
file_in_test_session = "01.down.south.mp3" | |
get :new | |
response.should have_selector("li", :id => test_session + | |
file_in_test_session, | |
:content => file_in_test_session) | |
end | |
describe "should NOT show" do | |
it "a song that is already in DB" do | |
se1 = Session.new(:session_date => | |
Date.strptime("2011.07.14","%Y.%m.%d").to_date) | |
so1 = se1.songs.new(:file_name => "01.golden_fields.mp3") | |
se1.save | |
get :new | |
response.should_not have_selector("li", | |
:id => | |
"2011.07.1401.golden_fields.mp3", | |
:content => | |
"01.golden_fields.mp3") | |
end | |
it "a session that contains no files" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment