Commit 3379c91b5f06c784fd33e4705ce37daf684cbc3d

Authored by Fellipe Souto
Committed by Rafael Manzo
1 parent 22441dcd

Unit test RepositoriesController refactored at show method

Signed-off By: Rafael Reggiani Manzo <rr.manzo@gmail.com>
spec/controllers/repositories_controller_spec.rb
... ... @@ -79,13 +79,13 @@ describe RepositoriesController do
79 79 end
80 80  
81 81 describe 'show' do
  82 + let(:repository) { FactoryGirl.build(:repository)}
82 83 before :each do
83   - @subject = FactoryGirl.build(:repository)
84   - @subject.expects(:last_processing).returns(FactoryGirl.build(:processing))
85   - KalibroEntities::Entities::Configuration.expects(:find).with(@subject.id).returns(FactoryGirl.build(:configuration))
86   - Repository.expects(:find).with(@subject.id).returns(@subject)
  84 + repository.expects(:last_processing).returns(FactoryGirl.build(:processing))
  85 + KalibroEntities::Entities::Configuration.expects(:find).with(repository.id).returns(FactoryGirl.build(:configuration))
  86 + Repository.expects(:find).with(repository.id).returns(repository)
87 87  
88   - get :show, id: @subject.id.to_s, project_id: project.id.to_s
  88 + get :show, id: repository.id.to_s, project_id: project.id.to_s
89 89 end
90 90  
91 91 it { should render_template(:show) }
... ...