Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Commit

Permalink
All tests are passing on 1.2
Browse files Browse the repository at this point in the history
Haven't tested in production at all yet though.
  • Loading branch information
iloveitaly authored and romul committed Nov 5, 2012
1 parent 2053f31 commit 7902b8a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Gemfile
Expand Up @@ -2,8 +2,9 @@ source "http://rubygems.org"
gemspec

group :test do
gem 'sass'

gem 'sass-rails', '~> 3.2.5'
gem 'coffee-rails', '~> 3.2.1'

if RUBY_PLATFORM.downcase.include? "darwin"
gem 'rb-fsevent'
gem 'growl'
Expand Down
8 changes: 7 additions & 1 deletion app/models/spree/address_decorator.rb
Expand Up @@ -25,7 +25,13 @@ def can_be_deleted?
end

def to_s
"#{firstname} #{lastname}, #{address1} #{address2}, #{city}, #{state || state_name} #{zipcode}, #{country}"
[
"#{firstname} #{lastname}",
"#{address1}",
"#{address2}",
"#{city}, #{state || state_name} #{zipcode}",
"#{country}"
].join("<br/>").html_safe
end

# UPGRADE_CHECK if future versions of spree have a custom destroy function, this will break
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/checkout/_address.html.erb
Expand Up @@ -38,6 +38,6 @@
<% end %>

<hr class="space" />
<div class="form-buttons">
<input type="submit" class="continue button primary" value="<%=t("save_and_continue") %>" />
<div class="form-buttons" data-hook="buttons">
<%= submit_tag t(:save_and_continue), :class => 'continue button primary' %>
</div>
3 changes: 1 addition & 2 deletions spec/models/address_spec.rb
Expand Up @@ -36,8 +36,7 @@

it 'is displayed as string' do
a = address
# address.to_s.should eq("#{a.firstname} #{a.lastname}<br/>#{a.address1} #{a.address2}<br/>#{a.city}, #{a.state || a.state_name} #{a.zipcode}<br/>#{a.country}".html_safe)
address.to_s.should == "#{a.firstname} #{a.lastname}, #{a.address1} #{a.address2}, #{a.city}, #{a.state || a.state_name} #{a.zipcode}, #{a.country}".html_safe
address.to_s.should eq("#{a.firstname} #{a.lastname}<br/>#{a.address1}<br/>#{a.address2}<br/>#{a.city}, #{a.state || a.state_name} #{a.zipcode}<br/>#{a.country}".html_safe)
end

it 'is destroyed without saving used' do
Expand Down
8 changes: 4 additions & 4 deletions spec/requests/address_spec.rb
Expand Up @@ -8,13 +8,13 @@
visit spree.root_path

click_link I18n.t(:login)
sign_in!(user);
sign_in!(user)
click_link I18n.t(:my_account)

page.should have_content("Shipping Addresses")
page.should have_content(I18n.t(:shipping_addresses))

click_link "Add new shipping address"
page.should have_content("New Shipping Address")
click_link I18n.t(:add_new_shipping_address)
page.should have_content(I18n.t(:new_shipping_address))
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/requests/checkout_edit_address_spec.rb
Expand Up @@ -15,7 +15,7 @@
new_street = Faker::Address.street_address
fill_in I18n.t('activerecord.attributes.spree/address.address1'), :with => new_street
click_button "Update"
current_path.should == spree.checkout_path
current_path.should == spree.checkout_state_path('address')
within("h1") { page.should have_content("Checkout") }
within("#billing") do
page.should have_content(new_street)
Expand All @@ -30,7 +30,7 @@
new_street = Faker::Address.street_address
fill_in I18n.t('activerecord.attributes.spree/address.address1'), :with => new_street
click_button "Update"
current_path.should == spree.checkout_path
current_path.should == spree.checkout_state_path('address')
within("h1") { page.should have_content("Checkout") }
within("#shipping") do
page.should have_content(new_street)
Expand Down

0 comments on commit 7902b8a

Please sign in to comment.