Skip to content

Commit

Permalink
Added Placeholder value for receiving participant when updating charg…
Browse files Browse the repository at this point in the history
…es (#239)

* created unit test for organization model. almost done

* switching to goat branch to checkout akshay's commit

* begining to modify test class for organization_alias_class. trying to merge rumby's modification on factories into my test branch

* finished creating test class for organization_alias model. Everything functions properly

* updated test for organization_category model. Everything functions properly

* created new factory for organization_status_type. created a new test class for orgniazation_status but have been getting error message: factory not registered. Will come back to this later

* fixed error! added organization_status to the factory file. test for organization_status now passed!

* checking Rumby's PR. commiting before switching to goat

* fixed previous file name error. Test for organization_status_type passed

* finished up organization_timeline_entry test. removed duplicate schema comment in the status_type

* updated organization test to include dependency testing

* did some refactoring on organization_alias model and test

* created test function for downtime methods

* fixed syntax for org_category test. added test case for dependency

* fixed minor syntax in test case for org_status and org_status_type

* added test case for membership

* added test case for judge, judgement, judgement_category

* somehow event_type_test got updated with a new schema entry. Saving change before checking out akshay's unit tests

* updated TravisCI's timezone to US Eastern time, which should match with the built in timezone indicated in application.rb

* changed TRAVIS CI Setting to eastern time

* trying to see if this fix for time works

* travis yml syntax incorrect in the previous commit. just fixed it now. Hopefully this works

* travis could not load timezone data. trying a different method

* both attempts failed. reverted back to master branch version of travis configuration. Will create an issue

* added redirect back to organization as a temporary solution for bug #201

* made modification to the charge param and fixed odd behavior, described in issue #202

* added placeholder value so that the receiving_participant does not seem to disappear

* Update .travis.yml

* Update event_type_test.rb
  • Loading branch information
blinblinblin authored and AkshayGoradia committed Mar 7, 2017
1 parent be54814 commit bbb4739
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/controllers/charges_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def new

# GET /charges/1/edit
def edit
@current_receiving_participant = @charge.receiving_participant.nil? ? "" : @charge.receiving_participant.formatted_name
end

# POST /charges
Expand All @@ -76,7 +77,7 @@ def create
# PUT /charges/1.json
def update
@charge.is_approved = false
@charge.update(charge_params)
@charge.update_attributes(charge_params)
respond_with(@charge)
end

Expand All @@ -96,7 +97,8 @@ def destroy
def approve
@charge.is_approved = !@charge.is_approved
@charge.save
respond_with @charge, location: -> {charges_path}

respond_with(@charge, location: @charge.organization)
end

private
Expand Down
5 changes: 4 additions & 1 deletion app/views/charges/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ When adding a charge, please ensure that you add a detailed description. This al
<%= f.input_field :amount, :as => :string %>
</div>
<% end %>

<%= f.input :description, :as => :text, textarea: "{ font-size:16px; }" %>

<%= f.association :issuing_participant, :collection => Participant.scc %>

<%= f.input :receiving_participant do %>
<%= f.input_field :receiving_participant_id, as: :hidden %>
<%= text_field_tag 'card-number-input', nil, class: 'form-control' %>
<%= text_field_tag 'card-number-input', nil, placeholder: @current_receiving_participant, class: 'form-control'%>
<div id="participant-info"></div>
<% end %>
</div>
Expand Down
3 changes: 2 additions & 1 deletion test/unit/event_type_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
# **`display`** | `boolean` |
# **`id`** | `integer` | `not null, primary key`
# **`name`** | `string(255)` |
# **`priority`** | `integer` |
#

class EventTypeTest < ActiveSupport::TestCase
# Relationships
should have_many(:events)


end
end

0 comments on commit bbb4739

Please sign in to comment.