Created
November 22, 2011 22:52
-
-
Save ivanoats/1387312 to your computer and use it in GitHub Desktop.
basic controller test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe TechnologiesController do | |
describe "GET show" do | |
let(:technology) { mock_model(Technology, id: 1) } | |
it "shows a technology" do | |
get :show, :id => 1 | |
response.should be_success | |
end | |
it "shows the technology template" do | |
get :show, id: 1 | |
response.should render_template("show") | |
end | |
end | |
it "shows a list of technologies" do | |
get "index" | |
end | |
end |
Author
ivanoats
commented
Nov 22, 2011
adding
before :each do
Technology.stub(:find).with("1").and_return(@technology)
end
works!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment