Commit 29ba2e7da02b5bc196a6d7f7ebe165a4d48fa137

Authored by Rafael Manzo
1 parent 7ad76c21

Fixed unit tests for ResourceFinder that came from rebase

Gemfile.lock
1 1 GIT
2 2 remote: https://github.com/mezuro/kalibro_client
3   - revision: a4cbc5b350e5a4ea0b5abe6e2ec53008474df161
  3 + revision: a4a393e41b5cd53d55e91e574ab9a7d7e6eddc5d
4 4 specs:
5 5 kalibro_client (0.0.1)
6 6 activeresource (~> 4.0.0)
... ...
app/controllers/concerns/resource_finder.rb
... ... @@ -4,7 +4,7 @@ module ResourceFinder
4 4 def find_resource(klass, id)
5 5 begin
6 6 klass.find(id)
7   - rescue KalibroGatekeeperClient::Errors::RecordNotFound
  7 + rescue KalibroClient::Errors::RecordNotFound
8 8 respond_to do |format|
9 9 format.html { render file: "#{Rails.root}/public/404", layout: false, status: :not_found }
10 10 end
... ...
spec/controllers/concerns/resource_finder_spec.rb
... ... @@ -24,7 +24,7 @@ describe ResourceFinder, type: :controller do
24 24  
25 25 context 'when the resource does not exists' do
26 26 before :each do
27   - klass.expects(:find).with(id).raises(KalibroGatekeeperClient::Errors::RecordNotFound)
  27 + klass.expects(:find).with(id).raises(KalibroClient::Errors::RecordNotFound)
28 28 end
29 29  
30 30 # FIXME: this is not the best test, but it it's the closest we can think of
... ...
spec/controllers/projects_controller_spec.rb
... ... @@ -75,7 +75,7 @@ describe ProjectsController, :type => :controller do
75 75  
76 76 context 'when the project does not exists' do
77 77 before :each do
78   - Project.expects(:find).with(project.id).raises(KalibroGatekeeperClient::Errors::RecordNotFound)
  78 + Project.expects(:find).with(project.id).raises(KalibroClient::Errors::RecordNotFound)
79 79 get :show, :id => project.id
80 80 end
81 81  
... ...