Skip to content

Commit

Permalink
Fixed link to saved design and improved code a little
Browse files Browse the repository at this point in the history
  • Loading branch information
pepe committed Aug 11, 2010
1 parent de92633 commit 20548ef
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/controllers/design.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
@design.face = session['face']
@design.job = session['job']
@design.save
session['message'] = I18n.t('app.design_stored') % [@design.id]
redirect "/design/%s" % @design.id
@url = "/design/%s" % @design.id
session['message'] = I18n.t('app.design_stored') % @url
redirect @url
end

get :design, :map => '/design/:id' do
Expand Down
6 changes: 5 additions & 1 deletion app/locale/cz.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cz:
app:
title: me-tee triko o tobě
design_stored: "<a href='/%s'>Toto</a> je stránka s Vaším uloženým designem. Uložte si ji pro další zobrazení."
design_stored: "<a href='%s'>Toto</a> je stránka s Vaším uloženým designem. Uložte si ji pro další zobrazení."
design_restored: "Váš výběr byl obnoven"
business_conditions: "Obchodní podmínky"
how_to_buy: "Jak nakupovat"
Expand Down Expand Up @@ -98,3 +98,7 @@ cz:
image: Obrázek
type: Druh
filename: Soubor
hobby: Hobby
face: Tvář
job: Práce

2 changes: 1 addition & 1 deletion app/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ en:
app:
design_restored: Your design has been restored
title: me-tee t-shirt about you
design_stored: "<a href='/design/%s'>This</a> is a webpage containing Your stored design. Save the url for further visit."
design_stored: "<a href='%s'>This</a> is a webpage containing Your stored design. Save the url for further visit."
business_conditions: "Business conditions"
how_to_buy: "How to buy"
contact: "Contact us"
Expand Down
9 changes: 9 additions & 0 deletions features/save_design.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ Feature: Saving of design
When I follow 'save'
Then I should see 'This is a webpage containing Your stored design. Save the url for further visit.'
And I should see big 'angry' icon for 'face'

Scenario: Saved design link
Given I visit '/'
And I follow 'face angry'
And I follow 'hobby swim'
And I follow 'job cook'
And I follow 'save'
When I follow 'This'
Then I should see 'Your design has been restored'

0 comments on commit 20548ef

Please sign in to comment.