Skip to content
Browse files

Fix disappearing menu on invalid preferences submittal. Closes #120

  • Loading branch information...
1 parent 00a5f68 commit bbb5da3333abe243f2734a5c270960ab123b3e6f @saturnflyer saturnflyer committed Jun 24, 2010
View
1 CHANGELOG
@@ -2,6 +2,7 @@
=== Edge
+* Fixed a bug which could cause the preferences submenu to dissapear [Mario Visic, Jim Gay]
* Fixed a bug PostgreSQL for creating pages with nested attributes [Andrew Cates]
* Updated to Rails 2.3.8 [Jim Gay]
* Added admin and Radius tag pagination [William Ross]
View
1 CONTRIBUTORS
@@ -5,6 +5,7 @@ core:
=== Edge
+* Mario Visic
* Andrew Cates
* Janne Asmala
* Keith Bingman
View
6 app/controllers/admin/preferences_controller.rb
@@ -7,7 +7,7 @@ def initialize
end
def show
- redirect_to :action => 'edit'
+ render :edit
end
def edit
@@ -20,11 +20,11 @@ def update
redirect_to :action => 'show'
else
flash[:error] = t('preferences_controller.error_updating')
- render :action => 'edit'
+ render :edit
end
else
announce_bad_data
- render :action => 'edit'
+ render :edit
end
end
View
17 features/admin/user_preferences.feature
@@ -16,3 +16,20 @@ Feature: Edit user preferences
| existing |
| designer |
| non_admin |
+
+ Scenario Outline: Save invalid preferences
+ Given I am logged in as "<username>"
+ When I open my preferences
+ And I fill in "Username" with ""
+ And I press "Save Changes"
+ Then I should be on the preferences screen
+ And I should see "this must not be blank"
+ And I should see "Personal"
+
+ Examples:
+ | username |
+ | admin |
+ | another |
+ | existing |
+ | designer |
+ | non_admin |
View
2 features/support/paths.rb
@@ -26,7 +26,7 @@ def path_to(page_name, format=nil)
when /login/i
login_path(:format => format)
when /preferences/i
- edit_admin_preferences_path(:format => format)
+ admin_preferences_path(:format => format)
when /snippets/i
admin_snippets_path(:format => format)
when /login/i
View
2 lib/radiant/admin_ui.rb
@@ -141,7 +141,7 @@ def load_default_nav
nav << design
settings = nav_tab("Settings")
- settings << nav_item("Personal", "/admin/preferences/edit")
+ settings << nav_item("Personal", "/admin/preferences")
settings << nav_item("Users", "/admin/users")
settings << nav_item("Extensions", "/admin/extensions")
nav << settings

0 comments on commit bbb5da3

Please sign in to comment.
Something went wrong with that request. Please try again.