Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rerouted Project#tips and Project#deposits to Tips#index and Deposits#index * added TipsController#load_project method * added pretty user paths for #tips and #show * added pretty user paths tests * added features/step_definitions/users_steps.rb * added features/view_tips.feature NOTE: TipsController#load_project method is nearly identical to ProjectsController#load_project - they could probably be refactored into ApplicationController method
- Loading branch information
1 parent
2106e7b
commit ca6bac2
Showing
10 changed files
with
109 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
def create_user nickname , has_bitcoiin_address | ||
User.create do |user| | ||
user.name = nickname | ||
user.email = "#{nickname}@example.com" | ||
user.bitcoin_address = '1AFgARu7e5d8Lox6P2DSFX3MW8BtsVXEn5' if has_bitcoiin_address | ||
user.nickname = nickname | ||
user.password = Devise.friendly_token.first(Devise.password_length.min) | ||
user.skip_confirmation! | ||
end | ||
end | ||
|
||
Given /^a user named "(.*?)" exists (with|without?) a bitcoin address$/ do |nickname , with| | ||
(@users ||= {})[nickname] = (create_user nickname , (with.eql? 'with')) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Feature: Visitors should be able to see claimed tips | ||
Background: | ||
Given a "github" project named "seldon/seldons-project" exists | ||
And a user named "yugo" exists with a bitcoin address | ||
And a user named "gaal" exists without a bitcoin address | ||
And our fee is "0" | ||
And a deposit of "500" is made | ||
And the most recent commit is "AAA" | ||
And a new commit "BBB" with parent "AAA" | ||
And a new commit "CCC" with parent "BBB" | ||
And the author of commit "BBB" is "yugo" | ||
And the author of commit "CCC" is "gaal" | ||
When the project syncs with the remote repo | ||
Then there should be a tip of "5" for commit "BBB" | ||
And there should be a tip of "4.95" for commit "CCC" | ||
Given I'm not logged in | ||
|
||
Scenario: Visitors should see all claimed tips but not unclaimed tips | ||
When I visit the "tips" page | ||
Then I should be on the "tips" page | ||
And I should see "yugo" | ||
But I should not see "gaal" | ||
|
||
Scenario: Visitors should see all claimed tips per project but not unclaimed tips | ||
When I visit the "seldon/seldons-project github-project" page | ||
Then I should be on the "seldon/seldons-project github-project" page | ||
And I should see "yugo" | ||
But I should not see "gaal" | ||
When I visit the "seldon/seldons-project github-project tips" page | ||
Then I should be on the "seldon/seldons-project github-project tips" page | ||
And I should see "yugo" | ||
But I should not see "gaal" | ||
|
||
Scenario: Visitors should see all claimed tips per user but not unclaimed tips | ||
When I visit the "yugo user tips" page | ||
Then I should be on the "yugo user tips" page | ||
And I should see "yugo" | ||
When I visit the "gaal user tips" page | ||
Then I should be on the "users" page | ||
And I should see "yugo" | ||
And I should not see "gaal" | ||
But I should see "User not found" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters