Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed maps css

  • Loading branch information...
commit 9a8c3a4cda7e3bad60a7468f665f478ffe41a3cc 2 parents f45d3bb + 88941b1
Micah Rich authored
View
2  app/models/quantity.rb
@@ -3,6 +3,7 @@ def self.quantities
[ "12 pack",
"2L",
"30 pack",
+ "6 pack",
"baker's dozen",
"bottle",
"can",
@@ -17,7 +18,6 @@ def self.quantities
"jumbo",
"loaf",
"package",
- "six pack",
"slice",
"quart" ]
end
View
2  app/models/user.rb
@@ -12,6 +12,8 @@ class User < ActiveRecord::Base
has_many :purchases
+ before_validation_on_update :auto_geocode_address
+
def self.find_or_create_by_openid(openid_identity, registration, user)
User.find_by_openid_identity(openid_identity) ||
User.new(:openid_identity => openid_identity,
View
4 app/views/purchases/_form.html.erb
@@ -3,13 +3,13 @@
<p id="new-item-qty">
<%= f.label :quantity, "Qty." %>
- <%= f.text_field :quantity, :title => "qty", :class => 'prefilled' %>
+ <%= f.text_field :quantity, :title => "qty", :class => 'prefilled', :autocomplete => 'off' %>
<%= autocomplete_field :purchase, :quantity %>
</p>
<p id="new-item-name">
<%= f.label :name %>
- <%= f.text_field :item_name, :title => "name", :class => 'prefilled' %>
+ <%= f.text_field :item_name, :title => "name", :class => 'prefilled', :autocomplete => 'off' %>
<%= autocomplete_field :purchase, :item_name %>
</p>
View
4 public/stylesheets/main.css
@@ -292,11 +292,11 @@ input#purchase_quantity {
background-position: left;
background-image: url("/images/small-marker.png");
height: 14px;
- padding: 3px 0px 3px 24px;
+ padding: 8px 0px 8px 28px;
}
#picked-store a .loading {
- background-image: url("/images/ajax-loader.gif");
+ background-image: url("/images/milky-small.gif");
}
#picked-store #marker {
View
5 public/stylesheets/maps.css
@@ -36,9 +36,10 @@
cursor: pointer;
}
-.gmls {
+.gmls-search-form {
+ position: absolute;
bottom: 260px !important;
- left: 0px !important;
+ left: -65px !important;
}
.gmls-app {
View
5 test/shoulda_macros/should_autocomplete.rb
@@ -1,6 +1,11 @@
class Test::Unit::TestCase
def self.should_autocomplete_for(obj,field)
underscored = "#{obj}_#{field}"
+
+ should "turn autocomplete off for the #{underscored} input element" do
+ assert_select '*[id=?][autocomplete=off]', underscored
+ end
+
should "autocomplete #{obj} #{field}" do
assert_match %r{new Ajax.Autocompleter\(.*'#{underscored}',.*'#{underscored}_autocomplete',.*'/purchases/autocomplete_#{underscored}',.*\{method: 'get'\}\)}m,
@response.body
View
18 test/unit/user_test.rb
@@ -16,6 +16,11 @@ class UserTest < Test::Unit::TestCase
assert_equal "Joe", @user.first_name
end
+ should "geocode when saving with a new location" do
+ @user.expects(:auto_geocode_address)
+ @user.update_attributes!(:location => '100 Commonwealth Ave, Boston, MA')
+ end
+
context "with some Purchases" do
setup do
[:month,:week,:day,:hour].each do |time_ago|
@@ -138,7 +143,18 @@ class UserTest < Test::Unit::TestCase
@user = Factory(:user, :openid_identity => nil, :email => 'foo@example.com')
end
- should_require_attributes :email, :location, :latitude, :longitude
+ should_require_attributes :email, :location
+
+ [:latitude, :longitude].each do |field|
+ should "require #{field}" do
+ assert_valid @user
+
+ @user.send(:"#{field}=", nil)
+ @user.location = nil
+
+ assert !@user.valid?
+ end
+ end
end
context "an OpenID and location" do
Please sign in to comment.
Something went wrong with that request. Please try again.