Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@dblock Show rank section for N players, closes #14. #17

Merged
merged 1 commit into from
Jun 26, 2015

Conversation

wrgoldstein
Copy link
Contributor

No description provided.

@@ -19,6 +19,14 @@ def self.find_by_slack_mention(user_name)
User.where(user_name =~ /^<@(.*)>$/ ? { user_id: Regexp.last_match[1] } : { user_name: user_name }).first
end

def self.find_many_by_slack_mention(user_names)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since find_by_slack_mention doesn't raise an exception when a user isn't found, find_many_by_slack_mention shouldn't either. You pick: either change find_by_slack_mention to find_by_slack_mention! (bang method) and fail in there (and adjust callers) or return an array where some users may be nil and handle it in the caller. I don't have a preference.

@dblock
Copy link
Owner

dblock commented May 22, 2015

The model-level methods introduced like find_many_by_slack_mention need tests, please.

This is looking great!

it 'shows the smallest range of ranks for a list of players' do
users = [user_elo_38, user_elo_67].map(&:slack_mention)
expect(message: "gamebot rank #{users.join(' ')}").to respond_with_slack_message "2. #{user_elo_67}\n3. #{user_elo_42}\n4. #{user_elo_38}"
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should also work with the user slack ID, not just the slack mention, there should be a test like that.

@dblock
Copy link
Owner

dblock commented May 25, 2015

Also forgot to mention, README needs to change, the new command should be documented.

@dblock
Copy link
Owner

dblock commented May 25, 2015

And while you're at it, the API could support it as well.

@wrgoldstein wrgoldstein force-pushed the master branch 2 times, most recently from f6315ba to 7d51de1 Compare June 1, 2015 04:53
@dblock
Copy link
Owner

dblock commented Jun 10, 2015

This looks good, it needs to be rebased and squashed, please? There's one more comment re: a spec that you could/should probably address and the API.

@@ -31,4 +31,5 @@ group :test do
gem 'database_cleaner', '~> 1.4'
gem 'hyperclient'
gem 'rack-test', '~> 0.6.2'
gem 'pry'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove pry from here, no need for it.

dblock added a commit that referenced this pull request Jun 26, 2015
@dblock Show rank section for N players, closes #14.
@dblock dblock merged commit 410add4 into dblock:master Jun 26, 2015
@dblock
Copy link
Owner

dblock commented Jun 26, 2015

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants