Commit c1337feb7684b3e9c86e3df2615e4ad4de4d5737
Committed by
Daniela Feitosa
1 parent
11bee2c1
Exists in
master
and in
29 other branches
Organization Ratings Plugin redirection fix
- Redirection after rating a profile now sends to profile homepage instead of profile controller index. Signed-off-by: Daniela Soares Feitosa <danielafeitosa@colivre.coop.br>
Showing
2 changed files
with
8 additions
and
1 deletions
Show diff stats
plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb
... | ... | @@ -49,7 +49,7 @@ class OrganizationRatingsPluginProfileController < ProfileController |
49 | 49 | session[:notice] = _("Sorry, there were problems rating this profile.") |
50 | 50 | end |
51 | 51 | |
52 | - redirect_to :controller => 'profile', :action => 'index' | |
52 | + redirect_to profile.url | |
53 | 53 | end |
54 | 54 | |
55 | 55 | def create_rating_comment(rating) | ... | ... |
plugins/organization_ratings/test/functional/organization_ratings_plugin_profile_controller_test.rb
... | ... | @@ -29,6 +29,13 @@ class OrganizationRatingsPluginProfileControllerTest < ActionController::TestCas |
29 | 29 | assert_equal "#{@community.name} successfully rated!", session[:notice] |
30 | 30 | end |
31 | 31 | |
32 | + test "should redirect to profile home page" do | |
33 | + @community.home_page = @community.blog | |
34 | + @community.save | |
35 | + post :new_rating, profile: @community.identifier, :comments => {:body => "This is minor a test"}, :organization_rating_value => 3 | |
36 | + assert_redirected_to @community.url | |
37 | + end | |
38 | + | |
32 | 39 | test "Create community_rating without comment body" do |
33 | 40 | post :new_rating, profile: @community.identifier, :comments => {:body => ""}, :organization_rating_value => 2 |
34 | 41 | ... | ... |