Commit 00cd3ecc44a6c6d29565c95cd5173c8e5de35537

Authored by Marin Jankovski
1 parent b96ad52e

Use stub in testing.

Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
features/steps/project/wiki.rb
@@ -96,8 +96,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps @@ -96,8 +96,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
96 end 96 end
97 97
98 And 'I click on existing image link' do 98 And 'I click on existing image link' do
99 - Gollum::Wiki.any_instance.should_receive(:file).with("image.jpg", "master", true).and_return(Gollum::File.new(wiki.wiki))  
100 - Gollum::File.any_instance.should_receive(:mime_type).and_return("image/jpeg") 99 + file = Gollum::File.new(wiki.wiki)
  100 + Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file)
  101 + Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg")
101 page.should have_link('image', href: "image.jpg") 102 page.should have_link('image', href: "image.jpg")
102 click_on "image" 103 click_on "image"
103 end 104 end