Permalink
Browse files

Hit Rubyforge instead of stubbing the results.

  • Loading branch information...
Manfred committed Oct 22, 2010
1 parent 6a6914c commit 4bb7bfab049410008cf37d4df56310f380297be2
Showing with 5 additions and 9 deletions.
  1. +1 −9 site/app/controllers/gems_controller.rb
  2. +4 −0 site/test/functional/gems_controller_test.rb
@@ -1,13 +1,5 @@
class GemsController < ApplicationController
def index
- @gems = gems
- end
-
- private
-
- def gems
- JSON.parse(File.read(Rails.root + 'test/fixtures/files/gems.json')).map do |description|
- Mine::Gem.new(description)
- end
+ @gems = Mine.all
end
end
@@ -1,6 +1,10 @@
require File.expand_path('../../test_helper', __FILE__)
describe "On the", GemsController, "a visitor" do
+ before do
+ Mine.stubs(:fetch).returns(JSON.parse(File.read(File.expand_path('../../fixtures/files/gems.json', __FILE__))))
+ end
+
it "sees a page with all recommended gems" do
get :index
status.should.be :ok

0 comments on commit 4bb7bfa

Please sign in to comment.