Permalink
Browse files

User should see the payment page immediately after creating last Atte…

…ndee
  • Loading branch information...
1 parent 9cd8f23 commit 8fefbd1cc7eab86bf547963fb72d19f5b6e353c6 @jaredbeck jaredbeck committed May 30, 2012
@@ -68,6 +68,10 @@ img.thin-border { border: 1px solid black; }
.asymetrical-columns .left-column { display: inline-block; padding-right: 32px; width: 60%; vertical-align: top; }
.asymetrical-columns .right-column { display: inline-block; width: 30%; vertical-align: top; }
+/* A horizontal line of stuff, each one floated left with
+some padding between each -Jared 2012-05-30 */
+.floating-padded-line-item { float: left; padding: 1em 2em 1em 0em; }
+
/* Remove the default border on anchored images */
/* I hope this works as well as the img.border attribute -Jared 11/29/10 */
a img { border: none; }
@@ -346,7 +346,7 @@ def get_valid_page_from_params
def get_view_name_from_page( page )
Attendee.assert_valid_page(page)
- if %w[admin wishes].include?(page.to_s)
+ if %w[admin terminus wishes].include?(page.to_s)
view_name = page.to_s
elsif page == "basics"
view_name = "edit"
View
@@ -145,6 +145,8 @@ class Attendee < ActiveRecord::Base
# Class Methods
# =============
+ # TODO: This doesn't belong in the ORM model. It belongs in the
+ # registration_process model.
def self.assert_valid_page(p)
raise "Invalid page: #{p}" unless Attendee.pages.include?(p.to_s)
end
@@ -180,7 +182,7 @@ def self.internal_attributes
# `pages` returns an array of page names, in no particular order.
# Not all pages are part of the registration process.
def self.pages
- %w[admin basics events tournaments activities wishes]
+ %w[admin basics events tournaments activities terminus wishes]
end
def self.with_planlessness planlessness
@@ -27,9 +27,10 @@ def next_page(current_page, plan_category, events_of_interest)
return cat.present? ? plan_category_path(cat) : page_path(:wishes)
end
- # Coming from the final page, we always go to the "My Account" page next
+ # Coming from the wishes page (special request, roomate request,
+ # and discounts) go to the final page, aka. terminus
if current_page.to_s == "wishes"
- return my_account_path
+ return page_path(:terminus)
end
# If we're coming from one plan category, go to the next.
@@ -1,5 +1,5 @@
- if current_user.primary_attendee.present?
- %h2 Register another Attendee
+ %h2 Register Another Attendee
- else
%h2 Registration
@@ -0,0 +1,12 @@
+%h2= @attendee.full_name
+%p Thanks, your registration is complete! What next?
+
+.floating-padded-line-item
+ = button_to "Register Another Person", add_attendee_to_user_path(@attendee.user), :method => "get", :class => 'button-emphasis'
+ %p{ style: "width: 250px;"}
+ You may register as many people as you want on the same account.
+ Bring the whole family!
+.floating-padded-line-item
+ = button_to "Make a Payment", pay_user_path(@attendee.user), :method => "get", :class => 'button-emphasis'
+ %p{ style: "width: 175px;"}
+ Review your account balance and make a payment.
@@ -34,6 +34,16 @@
end
end
+ describe "#edit" do
+ context "terminus page" do
+ it "is successful" do
+ atnd = user.attendees.first
+ get :edit, year: atnd.year, id: atnd.id, page: :terminus
+ response.should be_success
+ end
+ end
+ end
+
describe "#index" do
it "excludes attendees with zero plans" do
a1 = FactoryGirl.create :attendee
@@ -37,9 +37,9 @@
end
context "after finishing the wishes page" do
- it "returns the path to my account" do
+ it "returns the path to the terminus page" do
subject.next_page(:wishes, nil, nil).should ==
- user_path(attendee.year, user)
+ edit_attendee_path(attendee.year, attendee, :terminus)
end
end

0 comments on commit 8fefbd1

Please sign in to comment.