{"action":"created","comment":{"url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/comments/29692403","id":29692403,"diff_hunk":"@@ -24,7 +24,12 @@ module VisitMethod\n         def visit(*args)\n           raise ArgumentError, \"Cannot pass block to visit()\" if block_given?\n \n-          full_path = site.generate_path(paths.first, *args)\n+          args = args.dup\n+          inner_options = args.last.is_a?(::Hash)? args.pop : {}\n+\n+          path = inner_options.delete(:via) || paths.first\n+\n+          full_path = site.generate_path(path, args, inner_options)","path":"lib/ae_page_objects/concerns/visitable.rb","position":10,"original_position":10,"commit_id":"5b2bb7e52d7bfe929bb01d3a3d66f8bea0b857ec","original_commit_id":"5b2bb7e52d7bfe929bb01d3a3d66f8bea0b857ec","user":{"login":"dtognazzini","id":90865,"avatar_url":"https://avatars.githubusercontent.com/u/90865?v=3","gravatar_id":"","url":"https://api.github.com/users/dtognazzini","html_url":"https://github.com/dtognazzini","followers_url":"https://api.github.com/users/dtognazzini/followers","following_url":"https://api.github.com/users/dtognazzini/following{/other_user}","gists_url":"https://api.github.com/users/dtognazzini/gists{/gist_id}","starred_url":"https://api.github.com/users/dtognazzini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtognazzini/subscriptions","organizations_url":"https://api.github.com/users/dtognazzini/orgs","repos_url":"https://api.github.com/users/dtognazzini/repos","events_url":"https://api.github.com/users/dtognazzini/events{/privacy}","received_events_url":"https://api.github.com/users/dtognazzini/received_events","type":"User","site_admin":false},"body":"`generate_path` should receive the path and the exact same `args` as passed to `visit` except for the `:via` key when present. \r\n\r\nPlease add tests covering the following invocations:\r\n\r\n```ruby\r\nPageObjects::Books::ShowPage.visit(book, :format => :json)\r\n# should invoke generate_path(<path>, book, :format => :json)\r\n\r\nPageObjects::Books::ShowPage.visit(book, :format => :json, :via => :something)\r\n# should invoke generate_path(<path>, book, :format => :json)\r\n\r\nPageObjects::Books::ShowPage.visit(something, something_else)\r\n# should invoke generate_path(<path>, something, something_else)\r\n\r\nPageObjects::Books::ShowPage.visit(something, something_else, :via => \"something\")\r\n# should invoke generate_path(<path>, something, something_else)\r\n```","created_at":"2015-05-05T17:34:08Z","updated_at":"2015-05-05T17:34:08Z","html_url":"https://github.com/appfolio/ae_page_objects/pull/103#discussion_r29692403","pull_request_url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/comments/29692403"},"html":{"href":"https://github.com/appfolio/ae_page_objects/pull/103#discussion_r29692403"},"pull_request":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103","id":25586814,"html_url":"https://github.com/appfolio/ae_page_objects/pull/103","diff_url":"https://github.com/appfolio/ae_page_objects/pull/103.diff","patch_url":"https://github.com/appfolio/ae_page_objects/pull/103.patch","issue_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues/103","number":103,"state":"open","locked":false,"title":"Enhance visit to support multiple paths [fix #90]","user":{"login":"ipmsteven","id":1436241,"avatar_url":"https://avatars.githubusercontent.com/u/1436241?v=3","gravatar_id":"","url":"https://api.github.com/users/ipmsteven","html_url":"https://github.com/ipmsteven","followers_url":"https://api.github.com/users/ipmsteven/followers","following_url":"https://api.github.com/users/ipmsteven/following{/other_user}","gists_url":"https://api.github.com/users/ipmsteven/gists{/gist_id}","starred_url":"https://api.github.com/users/ipmsteven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipmsteven/subscriptions","organizations_url":"https://api.github.com/users/ipmsteven/orgs","repos_url":"https://api.github.com/users/ipmsteven/repos","events_url":"https://api.github.com/users/ipmsteven/events{/privacy}","received_events_url":"https://api.github.com/users/ipmsteven/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-05T17:39:02Z","updated_at":"2015-05-05T17:34:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"559882a34c9a6cddb965e019ea66fa63c0a84137","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103/commits","review_comments_url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103/comments","review_comment_url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues/103/comments","statuses_url":"https://api.github.com/repos/appfolio/ae_page_objects/statuses/5b2bb7e52d7bfe929bb01d3a3d66f8bea0b857ec","head":{"label":"appfolio:enhanceVisit","ref":"enhanceVisit","sha":"5b2bb7e52d7bfe929bb01d3a3d66f8bea0b857ec","user":{"login":"appfolio","id":115119,"avatar_url":"https://avatars.githubusercontent.com/u/115119?v=3","gravatar_id":"","url":"https://api.github.com/users/appfolio","html_url":"https://github.com/appfolio","followers_url":"https://api.github.com/users/appfolio/followers","following_url":"https://api.github.com/users/appfolio/following{/other_user}","gists_url":"https://api.github.com/users/appfolio/gists{/gist_id}","starred_url":"https://api.github.com/users/appfolio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appfolio/subscriptions","organizations_url":"https://api.github.com/users/appfolio/orgs","repos_url":"https://api.github.com/users/appfolio/repos","events_url":"https://api.github.com/users/appfolio/events{/privacy}","received_events_url":"https://api.github.com/users/appfolio/received_events","type":"Organization","site_admin":false},"repo":{"id":7102043,"name":"ae_page_objects","full_name":"appfolio/ae_page_objects","owner":{"login":"appfolio","id":115119,"avatar_url":"https://avatars.githubusercontent.com/u/115119?v=3","gravatar_id":"","url":"https://api.github.com/users/appfolio","html_url":"https://github.com/appfolio","followers_url":"https://api.github.com/users/appfolio/followers","following_url":"https://api.github.com/users/appfolio/following{/other_user}","gists_url":"https://api.github.com/users/appfolio/gists{/gist_id}","starred_url":"https://api.github.com/users/appfolio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appfolio/subscriptions","organizations_url":"https://api.github.com/users/appfolio/orgs","repos_url":"https://api.github.com/users/appfolio/repos","events_url":"https://api.github.com/users/appfolio/events{/privacy}","received_events_url":"https://api.github.com/users/appfolio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appfolio/ae_page_objects","description":"AePageObjects provides a powerful and customizable implementation of the Page Object pattern built on top of Capybara to be used in automated acceptance test suites.","fork":false,"url":"https://api.github.com/repos/appfolio/ae_page_objects","forks_url":"https://api.github.com/repos/appfolio/ae_page_objects/forks","keys_url":"https://api.github.com/repos/appfolio/ae_page_objects/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appfolio/ae_page_objects/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appfolio/ae_page_objects/teams","hooks_url":"https://api.github.com/repos/appfolio/ae_page_objects/hooks","issue_events_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues/events{/number}","events_url":"https://api.github.com/repos/appfolio/ae_page_objects/events","assignees_url":"https://api.github.com/repos/appfolio/ae_page_objects/assignees{/user}","branches_url":"https://api.github.com/repos/appfolio/ae_page_objects/branches{/branch}","tags_url":"https://api.github.com/repos/appfolio/ae_page_objects/tags","blobs_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/refs{/sha}","trees_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appfolio/ae_page_objects/statuses/{sha}","languages_url":"https://api.github.com/repos/appfolio/ae_page_objects/languages","stargazers_url":"https://api.github.com/repos/appfolio/ae_page_objects/stargazers","contributors_url":"https://api.github.com/repos/appfolio/ae_page_objects/contributors","subscribers_url":"https://api.github.com/repos/appfolio/ae_page_objects/subscribers","subscription_url":"https://api.github.com/repos/appfolio/ae_page_objects/subscription","commits_url":"https://api.github.com/repos/appfolio/ae_page_objects/commits{/sha}","git_commits_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/commits{/sha}","comments_url":"https://api.github.com/repos/appfolio/ae_page_objects/comments{/number}","issue_comment_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues/comments{/number}","contents_url":"https://api.github.com/repos/appfolio/ae_page_objects/contents/{+path}","compare_url":"https://api.github.com/repos/appfolio/ae_page_objects/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appfolio/ae_page_objects/merges","archive_url":"https://api.github.com/repos/appfolio/ae_page_objects/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appfolio/ae_page_objects/downloads","issues_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues{/number}","pulls_url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls{/number}","milestones_url":"https://api.github.com/repos/appfolio/ae_page_objects/milestones{/number}","notifications_url":"https://api.github.com/repos/appfolio/ae_page_objects/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appfolio/ae_page_objects/labels{/name}","releases_url":"https://api.github.com/repos/appfolio/ae_page_objects/releases{/id}","created_at":"2012-12-10T22:34:14Z","updated_at":"2015-05-05T07:17:39Z","pushed_at":"2015-05-05T06:33:15Z","git_url":"git://github.com/appfolio/ae_page_objects.git","ssh_url":"git@github.com:appfolio/ae_page_objects.git","clone_url":"https://github.com/appfolio/ae_page_objects.git","svn_url":"https://github.com/appfolio/ae_page_objects","homepage":"","size":3363,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":25,"forks":4,"open_issues":25,"watchers":14,"default_branch":"master"}},"base":{"label":"appfolio:master","ref":"master","sha":"130b710b85fcc95e2e2d03fe2f95feb21331ebcd","user":{"login":"appfolio","id":115119,"avatar_url":"https://avatars.githubusercontent.com/u/115119?v=3","gravatar_id":"","url":"https://api.github.com/users/appfolio","html_url":"https://github.com/appfolio","followers_url":"https://api.github.com/users/appfolio/followers","following_url":"https://api.github.com/users/appfolio/following{/other_user}","gists_url":"https://api.github.com/users/appfolio/gists{/gist_id}","starred_url":"https://api.github.com/users/appfolio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appfolio/subscriptions","organizations_url":"https://api.github.com/users/appfolio/orgs","repos_url":"https://api.github.com/users/appfolio/repos","events_url":"https://api.github.com/users/appfolio/events{/privacy}","received_events_url":"https://api.github.com/users/appfolio/received_events","type":"Organization","site_admin":false},"repo":{"id":7102043,"name":"ae_page_objects","full_name":"appfolio/ae_page_objects","owner":{"login":"appfolio","id":115119,"avatar_url":"https://avatars.githubusercontent.com/u/115119?v=3","gravatar_id":"","url":"https://api.github.com/users/appfolio","html_url":"https://github.com/appfolio","followers_url":"https://api.github.com/users/appfolio/followers","following_url":"https://api.github.com/users/appfolio/following{/other_user}","gists_url":"https://api.github.com/users/appfolio/gists{/gist_id}","starred_url":"https://api.github.com/users/appfolio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appfolio/subscriptions","organizations_url":"https://api.github.com/users/appfolio/orgs","repos_url":"https://api.github.com/users/appfolio/repos","events_url":"https://api.github.com/users/appfolio/events{/privacy}","received_events_url":"https://api.github.com/users/appfolio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appfolio/ae_page_objects","description":"AePageObjects provides a powerful and customizable implementation of the Page Object pattern built on top of Capybara to be used in automated acceptance test suites.","fork":false,"url":"https://api.github.com/repos/appfolio/ae_page_objects","forks_url":"https://api.github.com/repos/appfolio/ae_page_objects/forks","keys_url":"https://api.github.com/repos/appfolio/ae_page_objects/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appfolio/ae_page_objects/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appfolio/ae_page_objects/teams","hooks_url":"https://api.github.com/repos/appfolio/ae_page_objects/hooks","issue_events_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues/events{/number}","events_url":"https://api.github.com/repos/appfolio/ae_page_objects/events","assignees_url":"https://api.github.com/repos/appfolio/ae_page_objects/assignees{/user}","branches_url":"https://api.github.com/repos/appfolio/ae_page_objects/branches{/branch}","tags_url":"https://api.github.com/repos/appfolio/ae_page_objects/tags","blobs_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/refs{/sha}","trees_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appfolio/ae_page_objects/statuses/{sha}","languages_url":"https://api.github.com/repos/appfolio/ae_page_objects/languages","stargazers_url":"https://api.github.com/repos/appfolio/ae_page_objects/stargazers","contributors_url":"https://api.github.com/repos/appfolio/ae_page_objects/contributors","subscribers_url":"https://api.github.com/repos/appfolio/ae_page_objects/subscribers","subscription_url":"https://api.github.com/repos/appfolio/ae_page_objects/subscription","commits_url":"https://api.github.com/repos/appfolio/ae_page_objects/commits{/sha}","git_commits_url":"https://api.github.com/repos/appfolio/ae_page_objects/git/commits{/sha}","comments_url":"https://api.github.com/repos/appfolio/ae_page_objects/comments{/number}","issue_comment_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues/comments{/number}","contents_url":"https://api.github.com/repos/appfolio/ae_page_objects/contents/{+path}","compare_url":"https://api.github.com/repos/appfolio/ae_page_objects/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appfolio/ae_page_objects/merges","archive_url":"https://api.github.com/repos/appfolio/ae_page_objects/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appfolio/ae_page_objects/downloads","issues_url":"https://api.github.com/repos/appfolio/ae_page_objects/issues{/number}","pulls_url":"https://api.github.com/repos/appfolio/ae_page_objects/pulls{/number}","milestones_url":"https://api.github.com/repos/appfolio/ae_page_objects/milestones{/number}","notifications_url":"https://api.github.com/repos/appfolio/ae_page_objects/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appfolio/ae_page_objects/labels{/name}","releases_url":"https://api.github.com/repos/appfolio/ae_page_objects/releases{/id}","created_at":"2012-12-10T22:34:14Z","updated_at":"2015-05-05T07:17:39Z","pushed_at":"2015-05-05T06:33:15Z","git_url":"git://github.com/appfolio/ae_page_objects.git","ssh_url":"git@github.com:appfolio/ae_page_objects.git","clone_url":"https://github.com/appfolio/ae_page_objects.git","svn_url":"https://github.com/appfolio/ae_page_objects","homepage":"","size":3363,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":25,"forks":4,"open_issues":25,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103"},"html":{"href":"https://github.com/appfolio/ae_page_objects/pull/103"},"issue":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/issues/103"},"comments":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/appfolio/ae_page_objects/statuses/5b2bb7e52d7bfe929bb01d3a3d66f8bea0b857ec"}}}}