{"action":"created","comment":{"url":"https://api.github.com/repos/rspec/rspec-rails/pulls/comments/35112348","id":35112348,"diff_hunk":"@@ -0,0 +1,27 @@\n+module RSpec\n+  module Rails\n+    # Builds paths for view specs using a particular route set.\n+    class ViewPathBuilder\n+      def initialize(route_set)\n+        self.class.send(:include, route_set.url_helpers)\n+      end","path":"lib/rspec/rails/view_path_builder.rb","position":7,"original_position":7,"commit_id":"4c1f41769afa648191c622c97fde2ef928b762bc","original_commit_id":"4c1f41769afa648191c622c97fde2ef928b762bc","user":{"login":"cupakromer","id":1524496,"avatar_url":"https://avatars.githubusercontent.com/u/1524496?v=3","gravatar_id":"","url":"https://api.github.com/users/cupakromer","html_url":"https://github.com/cupakromer","followers_url":"https://api.github.com/users/cupakromer/followers","following_url":"https://api.github.com/users/cupakromer/following{/other_user}","gists_url":"https://api.github.com/users/cupakromer/gists{/gist_id}","starred_url":"https://api.github.com/users/cupakromer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cupakromer/subscriptions","organizations_url":"https://api.github.com/users/cupakromer/orgs","repos_url":"https://api.github.com/users/cupakromer/repos","events_url":"https://api.github.com/users/cupakromer/events{/privacy}","received_events_url":"https://api.github.com/users/cupakromer/received_events","type":"User","site_admin":false},"body":"Is there a benefit to using this over storing the `route_set` and calling `route_set.url_for` below?","created_at":"2015-07-21T15:01:52Z","updated_at":"2015-07-21T15:01:52Z","html_url":"https://github.com/rspec/rspec-rails/pull/1402#discussion_r35112348","pull_request_url":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402","_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-rails/pulls/comments/35112348"},"html":{"href":"https://github.com/rspec/rspec-rails/pull/1402#discussion_r35112348"},"pull_request":{"href":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402"}}},"pull_request":{"url":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402","id":38046001,"html_url":"https://github.com/rspec/rspec-rails/pull/1402","diff_url":"https://github.com/rspec/rspec-rails/pull/1402.diff","patch_url":"https://github.com/rspec/rspec-rails/pull/1402.patch","issue_url":"https://api.github.com/repos/rspec/rspec-rails/issues/1402","number":1402,"state":"open","locked":false,"title":"Expose path to view specs","user":{"login":"sarahmei","id":56125,"avatar_url":"https://avatars.githubusercontent.com/u/56125?v=3","gravatar_id":"","url":"https://api.github.com/users/sarahmei","html_url":"https://github.com/sarahmei","followers_url":"https://api.github.com/users/sarahmei/followers","following_url":"https://api.github.com/users/sarahmei/following{/other_user}","gists_url":"https://api.github.com/users/sarahmei/gists{/gist_id}","starred_url":"https://api.github.com/users/sarahmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarahmei/subscriptions","organizations_url":"https://api.github.com/users/sarahmei/orgs","repos_url":"https://api.github.com/users/sarahmei/repos","events_url":"https://api.github.com/users/sarahmei/events{/privacy}","received_events_url":"https://api.github.com/users/sarahmei/received_events","type":"User","site_admin":false},"body":"Fix for https://github.com/rspec/rspec-rails/issues/1347.\r\n\r\nExpose inferred path data to view specs, since we already expose inferred controller & action. This will allow view specs to exercise views that depend on the current page.\r\n\r\nWe did two implementations - the first commit uses `rescue nil` - the second one has no rescues but uses somewhat awkward logic to iterate through the routes to find a matching one.\r\n\r\nIf you know of a better way to implement this without rescue...would love to hear about it.","created_at":"2015-06-18T19:55:16Z","updated_at":"2015-07-21T15:01:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f67ceca660cdfb7afb001d6cdbdf5ae6cb21c1cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402/commits","review_comments_url":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402/comments","review_comment_url":"https://api.github.com/repos/rspec/rspec-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rspec/rspec-rails/issues/1402/comments","statuses_url":"https://api.github.com/repos/rspec/rspec-rails/statuses/4c1f41769afa648191c622c97fde2ef928b762bc","head":{"label":"sarahmei:expose_path_to_view_specs","ref":"expose_path_to_view_specs","sha":"4c1f41769afa648191c622c97fde2ef928b762bc","user":{"login":"sarahmei","id":56125,"avatar_url":"https://avatars.githubusercontent.com/u/56125?v=3","gravatar_id":"","url":"https://api.github.com/users/sarahmei","html_url":"https://github.com/sarahmei","followers_url":"https://api.github.com/users/sarahmei/followers","following_url":"https://api.github.com/users/sarahmei/following{/other_user}","gists_url":"https://api.github.com/users/sarahmei/gists{/gist_id}","starred_url":"https://api.github.com/users/sarahmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarahmei/subscriptions","organizations_url":"https://api.github.com/users/sarahmei/orgs","repos_url":"https://api.github.com/users/sarahmei/repos","events_url":"https://api.github.com/users/sarahmei/events{/privacy}","received_events_url":"https://api.github.com/users/sarahmei/received_events","type":"User","site_admin":false},"repo":{"id":37553566,"name":"rspec-rails","full_name":"sarahmei/rspec-rails","owner":{"login":"sarahmei","id":56125,"avatar_url":"https://avatars.githubusercontent.com/u/56125?v=3","gravatar_id":"","url":"https://api.github.com/users/sarahmei","html_url":"https://github.com/sarahmei","followers_url":"https://api.github.com/users/sarahmei/followers","following_url":"https://api.github.com/users/sarahmei/following{/other_user}","gists_url":"https://api.github.com/users/sarahmei/gists{/gist_id}","starred_url":"https://api.github.com/users/sarahmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarahmei/subscriptions","organizations_url":"https://api.github.com/users/sarahmei/orgs","repos_url":"https://api.github.com/users/sarahmei/repos","events_url":"https://api.github.com/users/sarahmei/events{/privacy}","received_events_url":"https://api.github.com/users/sarahmei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sarahmei/rspec-rails","description":"RSpec for Rails-3+","fork":true,"url":"https://api.github.com/repos/sarahmei/rspec-rails","forks_url":"https://api.github.com/repos/sarahmei/rspec-rails/forks","keys_url":"https://api.github.com/repos/sarahmei/rspec-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sarahmei/rspec-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sarahmei/rspec-rails/teams","hooks_url":"https://api.github.com/repos/sarahmei/rspec-rails/hooks","issue_events_url":"https://api.github.com/repos/sarahmei/rspec-rails/issues/events{/number}","events_url":"https://api.github.com/repos/sarahmei/rspec-rails/events","assignees_url":"https://api.github.com/repos/sarahmei/rspec-rails/assignees{/user}","branches_url":"https://api.github.com/repos/sarahmei/rspec-rails/branches{/branch}","tags_url":"https://api.github.com/repos/sarahmei/rspec-rails/tags","blobs_url":"https://api.github.com/repos/sarahmei/rspec-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sarahmei/rspec-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sarahmei/rspec-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/sarahmei/rspec-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sarahmei/rspec-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/sarahmei/rspec-rails/languages","stargazers_url":"https://api.github.com/repos/sarahmei/rspec-rails/stargazers","contributors_url":"https://api.github.com/repos/sarahmei/rspec-rails/contributors","subscribers_url":"https://api.github.com/repos/sarahmei/rspec-rails/subscribers","subscription_url":"https://api.github.com/repos/sarahmei/rspec-rails/subscription","commits_url":"https://api.github.com/repos/sarahmei/rspec-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/sarahmei/rspec-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/sarahmei/rspec-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/sarahmei/rspec-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/sarahmei/rspec-rails/contents/{+path}","compare_url":"https://api.github.com/repos/sarahmei/rspec-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sarahmei/rspec-rails/merges","archive_url":"https://api.github.com/repos/sarahmei/rspec-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sarahmei/rspec-rails/downloads","issues_url":"https://api.github.com/repos/sarahmei/rspec-rails/issues{/number}","pulls_url":"https://api.github.com/repos/sarahmei/rspec-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/sarahmei/rspec-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/sarahmei/rspec-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sarahmei/rspec-rails/labels{/name}","releases_url":"https://api.github.com/repos/sarahmei/rspec-rails/releases{/id}","created_at":"2015-06-16T20:13:40Z","updated_at":"2015-06-16T20:13:41Z","pushed_at":"2015-07-12T23:10:20Z","git_url":"git://github.com/sarahmei/rspec-rails.git","ssh_url":"git@github.com:sarahmei/rspec-rails.git","clone_url":"https://github.com/sarahmei/rspec-rails.git","svn_url":"https://github.com/sarahmei/rspec-rails","homepage":"http://relishapp.com/rspec/rspec-rails","size":3580,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rspec:master","ref":"master","sha":"1fb6f9f642e887df1b1ee344594de02d7de3b3fe","user":{"login":"rspec","id":22388,"avatar_url":"https://avatars.githubusercontent.com/u/22388?v=3","gravatar_id":"","url":"https://api.github.com/users/rspec","html_url":"https://github.com/rspec","followers_url":"https://api.github.com/users/rspec/followers","following_url":"https://api.github.com/users/rspec/following{/other_user}","gists_url":"https://api.github.com/users/rspec/gists{/gist_id}","starred_url":"https://api.github.com/users/rspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rspec/subscriptions","organizations_url":"https://api.github.com/users/rspec/orgs","repos_url":"https://api.github.com/users/rspec/repos","events_url":"https://api.github.com/users/rspec/events{/privacy}","received_events_url":"https://api.github.com/users/rspec/received_events","type":"Organization","site_admin":false},"repo":{"id":447184,"name":"rspec-rails","full_name":"rspec/rspec-rails","owner":{"login":"rspec","id":22388,"avatar_url":"https://avatars.githubusercontent.com/u/22388?v=3","gravatar_id":"","url":"https://api.github.com/users/rspec","html_url":"https://github.com/rspec","followers_url":"https://api.github.com/users/rspec/followers","following_url":"https://api.github.com/users/rspec/following{/other_user}","gists_url":"https://api.github.com/users/rspec/gists{/gist_id}","starred_url":"https://api.github.com/users/rspec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rspec/subscriptions","organizations_url":"https://api.github.com/users/rspec/orgs","repos_url":"https://api.github.com/users/rspec/repos","events_url":"https://api.github.com/users/rspec/events{/privacy}","received_events_url":"https://api.github.com/users/rspec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rspec/rspec-rails","description":"RSpec for Rails-3+","fork":false,"url":"https://api.github.com/repos/rspec/rspec-rails","forks_url":"https://api.github.com/repos/rspec/rspec-rails/forks","keys_url":"https://api.github.com/repos/rspec/rspec-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rspec/rspec-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rspec/rspec-rails/teams","hooks_url":"https://api.github.com/repos/rspec/rspec-rails/hooks","issue_events_url":"https://api.github.com/repos/rspec/rspec-rails/issues/events{/number}","events_url":"https://api.github.com/repos/rspec/rspec-rails/events","assignees_url":"https://api.github.com/repos/rspec/rspec-rails/assignees{/user}","branches_url":"https://api.github.com/repos/rspec/rspec-rails/branches{/branch}","tags_url":"https://api.github.com/repos/rspec/rspec-rails/tags","blobs_url":"https://api.github.com/repos/rspec/rspec-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rspec/rspec-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rspec/rspec-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rspec/rspec-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rspec/rspec-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rspec/rspec-rails/languages","stargazers_url":"https://api.github.com/repos/rspec/rspec-rails/stargazers","contributors_url":"https://api.github.com/repos/rspec/rspec-rails/contributors","subscribers_url":"https://api.github.com/repos/rspec/rspec-rails/subscribers","subscription_url":"https://api.github.com/repos/rspec/rspec-rails/subscription","commits_url":"https://api.github.com/repos/rspec/rspec-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rspec/rspec-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rspec/rspec-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rspec/rspec-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rspec/rspec-rails/contents/{+path}","compare_url":"https://api.github.com/repos/rspec/rspec-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rspec/rspec-rails/merges","archive_url":"https://api.github.com/repos/rspec/rspec-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rspec/rspec-rails/downloads","issues_url":"https://api.github.com/repos/rspec/rspec-rails/issues{/number}","pulls_url":"https://api.github.com/repos/rspec/rspec-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rspec/rspec-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rspec/rspec-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rspec/rspec-rails/labels{/name}","releases_url":"https://api.github.com/repos/rspec/rspec-rails/releases{/id}","created_at":"2009-12-23T16:40:53Z","updated_at":"2015-07-21T03:37:12Z","pushed_at":"2015-07-15T17:18:42Z","git_url":"git://github.com/rspec/rspec-rails.git","ssh_url":"git@github.com:rspec/rspec-rails.git","clone_url":"https://github.com/rspec/rspec-rails.git","svn_url":"https://github.com/rspec/rspec-rails","homepage":"http://relishapp.com/rspec/rspec-rails","size":7379,"stargazers_count":2421,"watchers_count":2421,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":474,"mirror_url":null,"open_issues_count":48,"forks":474,"open_issues":48,"watchers":2421,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402"},"html":{"href":"https://github.com/rspec/rspec-rails/pull/1402"},"issue":{"href":"https://api.github.com/repos/rspec/rspec-rails/issues/1402"},"comments":{"href":"https://api.github.com/repos/rspec/rspec-rails/issues/1402/comments"},"review_comments":{"href":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402/comments"},"review_comment":{"href":"https://api.github.com/repos/rspec/rspec-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rspec/rspec-rails/pulls/1402/commits"},"statuses":{"href":"https://api.github.com/repos/rspec/rspec-rails/statuses/4c1f41769afa648191c622c97fde2ef928b762bc"}}}}