Retaining specs and line from robustdj's patch
This commit is contained in:
parent
a3ce5f1cd7
commit
bbd8cadc14
2 changed files with 15 additions and 1 deletions
|
|
@ -101,6 +101,7 @@ en:
|
|||
new_album: "New Album"
|
||||
create:
|
||||
success: "You've created an album called %{name}."
|
||||
failure: "Failed to create album."
|
||||
update:
|
||||
success: "Album %{name} successfully edited."
|
||||
failure: "Failed to edit album %{name}."
|
||||
|
|
|
|||
|
|
@ -22,6 +22,19 @@ describe AlbumsController do
|
|||
params = {"album" => {"name" => "Sunsets","to" => @aspect.id.to_s}}
|
||||
post :create, params
|
||||
end
|
||||
|
||||
context 'with invalid params' do
|
||||
it 'should render a flash error message when album name is blank' do
|
||||
params = {"album" => {"name" => "", "to" => "all"}}
|
||||
post :create, params
|
||||
flash[:error].should == "Failed to create album."
|
||||
end
|
||||
it 'should redirect back to album page for that given aspect' do
|
||||
params = {"album" => {"name" => "", "to" => "all"}}
|
||||
post :create, params
|
||||
response.should redirect_to albums_path(:aspect => "all")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#update" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue