Skip to content

Commit

Permalink
[#2] Migration create_cursos apagada
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromamede committed Oct 26, 2013
1 parent 87ea284 commit ed5163e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
13 changes: 10 additions & 3 deletions app/controllers/turmas_controller.rb
Expand Up @@ -12,7 +12,14 @@ def create
respond_with @turma
end

def turma_params
params.require(:turma).permit(:curso_id, datas_attributes: [:data])
end
def show
Turma.find(turma_params[:id])
end

private
def turma_params
params.require(:turma).permit(:curso_id, datas_attributes: [:data])
end


end
9 changes: 0 additions & 9 deletions db/migrate/20131026181826_create_cursos.rb

This file was deleted.

6 changes: 6 additions & 0 deletions spec/controllers/turmas_controller_spec.rb
Expand Up @@ -17,4 +17,10 @@
end
end

describe "GET 'show' " do
it "Deve chamar o metodo show" do
Turma.should_receive(:find).once
get 'show', id: 1
end
end
end

0 comments on commit ed5163e

Please sign in to comment.