Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer controller.request.path_params["controller"] from the file being
rendered in a view spec. - Closes #172.
- Loading branch information
1 parent
290357c
commit 732a922
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
Feature: view spec infers controller path | |||
|
|||
Scenario: | |||
Given a file named "app/views/widgets/other.html.erb" with: | |||
""" | |||
<%= link_to "new", :action => "new" %> | |||
""" | |||
And a file named "spec/views/widgets/other.html.erb_spec.rb" with: | |||
""" | |||
require "spec_helper" | |||
describe "widgets/other.html.erb" do | |||
it "includes a link to new" do | |||
render | |||
rendered.should have_selector("a", :href => "/widgets/new") | |||
end | |||
end | |||
""" | |||
When I run "rspec spec/views" | |||
Then the output should contain "1 example, 0 failures" | |||
|
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