Skip to content

Commit

Permalink
Inverted wording of hold checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmike committed May 29, 2014
1 parent e4b4d66 commit cba15b2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/projects_controller.rb
Expand Up @@ -94,7 +94,7 @@ def create

private
def project_params
params.require(:project).permit(:name, :description, :full_name, :hold_tips, tipping_policies_text_attributes: [:text])
params.require(:project).permit(:name, :description, :full_name, :auto_tip_commits, :hold_tips, tipping_policies_text_attributes: [:text])
end

def load_project
Expand Down
11 changes: 11 additions & 0 deletions app/models/project.rb
Expand Up @@ -233,4 +233,15 @@ def strip_full_name
self.full_name = full_name.gsub(/https?\:\/\/github.com\//, '')
end
end

def auto_tip_commits
!hold_tips
end

def auto_tip_commits=(value)
self.hold_tips = case value
when false, nil, "0" then true
else false
end
end
end
2 changes: 1 addition & 1 deletion app/views/projects/_form.html.haml
Expand Up @@ -6,6 +6,6 @@
= fields.text_area :text, rows: 10, label: "Tipping policies"
= f.url_field :full_name, label: "GitHub URL (optional)"
= f.form_group do
= f.check_box :hold_tips, label: "Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent"
= f.check_box :auto_tip_commits, {label: "Automatically send 1% of the balance to each commit added to the default branch of the GitHub project"}
= f.form_group do
= f.primary "Save"
4 changes: 4 additions & 0 deletions features/step_definitions/web.rb
Expand Up @@ -53,6 +53,10 @@
check(arg1)
end

Given(/^I uncheck "(.*?)"$/) do |arg1|
uncheck(arg1)
end

Then(/^I should see "(.*?)"$/) do |arg1|
page.should have_content(arg1)
end
Expand Down
2 changes: 1 addition & 1 deletion features/tip_modifier_interface.feature
Expand Up @@ -23,7 +23,7 @@ Feature: A project collaborator can change the tips of commits
Given I'm logged in as "seldon"
And I go to the project page
And I click on "Change project settings"
And I check "Do not send the tips immediatly. Give collaborators the ability to modify the tips before they're sent"
And I uncheck "Automatically send 1% of the balance to each commit added to the default branch of the GitHub project"
And I click on "Save"
Then I should see "The project has been updated"

Expand Down

0 comments on commit cba15b2

Please sign in to comment.