Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git@github.com:railsrumble/giant-robots

Conflicts:

	public/stylesheets/main.css
  • Loading branch information...
commit 7bdacd8674505c273af2f05cb73c16a06e521fb0 2 parents 1dcf3fb + 2710733
Chad Pytel authored
View
1  app/views/layouts/application.html.erb
@@ -15,6 +15,7 @@
<div id="header">
<h1 id="logo"><%= link_to %{<span class="invisible">Where's the Milk at?</span>}, root_url %></h1>
+ <p id="hello">Hey there, <%= user_name %></p>
<div id="menu">
<ul>
<li id="purchases-index" ><%= link_to 'Purchases', purchases_path %></li>
View
9 app/views/users/new.html.erb
@@ -1,7 +1,10 @@
<div id="account-changes">
<div class="signup-map" id="map" style="width: 475px; height: 169px;"></div>
- <% form_tag openid_path, :id => "openid_form" do %>
+ <% form_tag openid_path,
+ :id => "openid_form",
+ :style => "display: #{params[:user_type] == 'human' ? 'none' : 'block'};" do %>
+ <%= hidden_field_tag 'user_type', 'openid' %>
<div class="text_field">
<label for="openid_identifier">
Open ID <%= link_to_function "Login like a Human", "$('openid_form').hide(); $('new_user').show();" %>
@@ -18,7 +21,9 @@
</p>
<% end %>
- <% form_for @user, :html => { :style => "display: none;" } do |form| %>
+ <% form_for @user,
+ :html => { :style => "display: #{params[:user_type] == 'human' ? 'block' : 'none'};" } do |form| %>
+ <%= hidden_field_tag 'user_type', 'human' %>
<%= form.error_messages %>
<div class="text_field">
<label for="user_email">
View
8 public/stylesheets/main.css
@@ -1077,7 +1077,13 @@ body.stores #map {
#account-changes.confirmation {
text-align: center;
}
-
#account-changes.confirmation .submit_field {
text-align: center;
+}
+
+#hello {
+ float: right;
+ margin-top: 17px;
+ margin-right: 200px;
+ color: #91cfd3;
}
View
28 test/functional/users_controller_test.rb
@@ -15,6 +15,34 @@ class UsersControllerTest < ActionController::TestCase
should_have_map_observer map
end
end
+
+ context "POST to create as a human" do
+ setup do
+ post :create, :user_type => 'human'
+ end
+
+ should "display the human form" do
+ assert_select '#new_user[style="display: block;"]'
+ end
+
+ should "hide the openid form" do
+ assert_select '#openid_form[style="display: none;"]'
+ end
+ end
+
+ context "POST to create using openid" do
+ setup do
+ post :create, :user_type => 'openid'
+ end
+
+ should "hide the human form" do
+ assert_select '#new_user[style="display: none;"]'
+ end
+
+ should "display the openid form" do
+ assert_select '#openid_form[style="display: block;"]'
+ end
+ end
public_context do
context "with a user" do
Please sign in to comment.
Something went wrong with that request. Please try again.