Skip to content

Commit

Permalink
Make Rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusaraj committed Jul 30, 2019
1 parent b7f7251 commit a23584f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
14 changes: 7 additions & 7 deletions lib/discourse_code_review/github_user_syncer.rb
Expand Up @@ -7,13 +7,13 @@ def ensure_user(name:, email: nil, github_login: nil, github_id: nil)

user ||=
if github_id
User.find_by(
id:
UserCustomField
.select(:user_id)
.where(name: GithubId, value: github_id)
.limit(1)
)
User.find_by(
id:
UserCustomField
.select(:user_id)
.where(name: GithubId, value: github_id)
.limit(1)
)
end

user ||=
Expand Down
5 changes: 2 additions & 3 deletions lib/discourse_code_review/importer.rb
Expand Up @@ -14,7 +14,6 @@ def self.sync_commit(sha)
repo = GithubRepo.new(repo_name, client)
importer = Importer.new(repo)


if commit = repo.commit(sha)
importer.sync_commit(commit)
return repo_name
Expand Down Expand Up @@ -184,8 +183,8 @@ def import_commit(commit)
value: commit[:hash]
)

linked_topics.values.each do |topic|
topic.add_moderator_post(
linked_topics.values.each do |topik|
topik.add_moderator_post(
user,
" #{post.topic.url}",
bump: false,
Expand Down
Expand Up @@ -99,7 +99,7 @@

expect(commit.user.notifications.count).to eq(1)
notification = commit.user.notifications.first
expect(JSON.parse(notification.data)).to eq({ "num_approved_commits" => 1 })
expect(JSON.parse(notification.data)).to eq("num_approved_commits" => 1)
expect(notification.topic_id).to eq(commit.topic.id)
expect(notification.post_number).to eq(2)
end
Expand Down Expand Up @@ -127,7 +127,7 @@

expect(author.notifications.count).to eq(1)
notification = author.notifications.first
expect(JSON.parse(notification.data)).to eq({ "num_approved_commits" => 2 })
expect(JSON.parse(notification.data)).to eq("num_approved_commits" => 2)
expect(notification.topic_id).to be_nil
expect(notification.post_number).to be_nil
end
Expand Down

0 comments on commit a23584f

Please sign in to comment.