-
Notifications
You must be signed in to change notification settings - Fork 21
Add sorting of doc_methods on a repo by documentation status #24
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,7 @@ def self.find_for_github_oauth(auth, signed_in_resource=nil) | |
| user.update_attributes(params) | ||
| else | ||
| email = auth.info.email | ||
| email = GitHubBub::Request.fetch("/user/emails", token: token).json_body.first if email.blank? | ||
| email = GitHubBub.get("/user/emails", token: token).json_body.first if email.blank? | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @schneems You would know, because you wrote There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HA!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, that's an older API |
||
| params = params.merge(:password => Devise.friendly_token[0,20], | ||
| :name => auth.extra.raw_info.name, | ||
| :email => email) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| comment: | ||
| id: 1 | ||
| doc_class_id: 1 | ||
| doc_method_id: 2 | ||
| comment: 'this is a comment' | ||
| created_at: 2012-11-10 21:50:48.351554000 Z | ||
| updated_at: 2012-11-10 21:50:48.351554000 Z |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| migrate: | ||
| id: 1 | ||
| repo_id: 3 | ||
| name: undocumented_method | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if it's important to you to have real file and method names, but it makes the tests clearer to write it this way. |
||
| line: 43 | ||
| created_at: 2012-11-10 21:50:48.351554000 Z | ||
| updated_at: 2012-11-10 21:50:48.351554000 Z | ||
| doc_comments_count: 0 | ||
| path: 'lib/sinatra' | ||
| file: 'base.rb' | ||
|
|
||
| other: | ||
| id: 2 | ||
| repo_id: 3 | ||
| name: documented_method | ||
| line: 43 | ||
| created_at: 2012-11-10 21:50:48.351554000 Z | ||
| updated_at: 2012-11-10 21:50:48.351554000 Z | ||
| doc_comments_count: 100 | ||
| path: 'lib/sinatra' | ||
| file: 'base.rb' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| require "test_helper" | ||
|
|
||
| class SortingMethodsTest < ActionDispatch::IntegrationTest | ||
| include Capybara::DSL | ||
| fixtures :repos | ||
| fixtures :doc_methods | ||
| fixtures :doc_comments | ||
|
|
||
| test 'sorting methods by documentation status' do | ||
| visit '/' | ||
| click_link 'rails' | ||
| click_link 'Documented Methods' | ||
| assert_not page.has_content?('ActiveRecord#undocumented') | ||
| click_link 'Undocumented Methods' | ||
| assert_not page.has_content?('ActiveRecord#documented') | ||
| end | ||
|
|
||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I like this style. Very smooth...
I haven't hit
#send's guts yet but I love the idea of the params being passed to a method named as such. Nice