Skip to content

Commit

Permalink
Default session RSVP checkboxes to checked
Browse files Browse the repository at this point in the history
  • Loading branch information
tjgrathwell committed Mar 19, 2013
1 parent 5c30f13 commit e91cb27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/rsvps/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<strong>Sessions you're attending</strong>
<% @rsvp.event.event_sessions.order('starts_at ASC').each do |session| %>
<%= label_tag do %>
<%= check_box_tag 'rsvp_sessions[]', session.id, @rsvp.rsvp_sessions.where(event_session_id: session.id).any? %>
<%= check_box_tag 'rsvp_sessions[]', session.id, @rsvp.new_record? ? true : @rsvp.rsvp_sessions.where(event_session_id: session.id).any? %>
<%= session.name %>: <%= formatted_session_date(session) %> <%= formatted_session_timerange(session) %>
<% end %>
<% end %>
Expand Down
4 changes: 3 additions & 1 deletion spec/requests/event_listing_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
fill_in "rsvp_teaching_experience", :with => "I have taught all kinds of things."
check 'Teaching'

check "Installfest"
page.find("input[type='checkbox'][value='#{@session1.id}']").should be_checked
page.find("input[type='checkbox'][value='#{@session2.id}']").should be_checked

uncheck "Curriculum"

click_button "Submit"
Expand Down

0 comments on commit e91cb27

Please sign in to comment.