Skip to content

Instantly share code, notes, and snippets.

@mulderp
Created January 13, 2011 15:37
Show Gist options
  • Save mulderp/778053 to your computer and use it in GitHub Desktop.
Save mulderp/778053 to your computer and use it in GitHub Desktop.
rspec a view of images
describe "main/index.html.erb" do
before(:each) do
@designs = mock("array of design")
@designs.stub!(:designs).and_return("test")
@d = mock("design")
@d.stub!(:name).and_return("test")
@d.stub!(:photo).and_return("medium_size.jpg")
@designs.stub!(:at).with(0).and_return(@d)
end
it "displays influence products" do
# assign(:designs, stub_model(Array.new(@d)))
render
rendered.should include("Influence")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment