Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
fix bug: GithubController#hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mzp committed May 2, 2014
1 parent ff65d51 commit 7efee06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/github_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def import(url)
owner, repos = commit.project.split('/', 2)
project = Project.where(owner: owner, repos: repos).first_or_create!

project.users << current_user
project.users << current_user if current_user

# update other attributes
rev.update_attributes(commit.to_h.merge(project: project))
Expand Down
4 changes: 3 additions & 1 deletion spec/controllers/github_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def commit(opt)
before do
RevisionIt::Service::Github.
stub(:commits).
with('https://example.com')
with('https://example.com').
and_yield(commit(hash_code: "foo", url: "http://example.com", log: "this is text")).
and_yield(commit(hash_code: "bar", url: "http://example.com", log: "this is text", project: "mzp/hoge" ))

post 'hook', payload: { repository: { url: 'https://example.com' } }.to_json
end
Expand Down

0 comments on commit 7efee06

Please sign in to comment.