Skip to content

Commit

Permalink
Added specs for our new file action, should really change this to ano…
Browse files Browse the repository at this point in the history
…ther more appropriate action name
  • Loading branch information
baphled committed Jul 5, 2010
1 parent 162bcb4 commit 70efc74
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/controllers/features_controller_spec.rb
Expand Up @@ -354,4 +354,22 @@ def mock_feature(stubs={})
end
end
end

describe "GET, file" do
before(:each) do
@feature = mock_model(Feature,:title=>"A new feature").as_null_object
@feature.stub!(:path).and_return "#{RAILS_ROOT}/features/plain/tag_cloud.feature"
Feature.stub!(:find).and_return @feature
end

it "finds the feature" do
Feature.should_receive :find
get :file, {:feature => @feature}
end

it "should open and read the feature file" do
File.should_receive :read
get :file, {:feature => @feature}
end
end
end

0 comments on commit 70efc74

Please sign in to comment.