Commit 8466f52234df46c31421a3a949b7b6292cb2fe08

Authored by Tallys Martins
1 parent 93e9e4c0

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>
plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb
@@ -49,7 +49,7 @@ class OrganizationRatingsPluginProfileController &lt; ProfileController @@ -49,7 +49,7 @@ class OrganizationRatingsPluginProfileController &lt; ProfileController
49 session[:notice] = _("Sorry, there were problems rating this profile.") 49 session[:notice] = _("Sorry, there were problems rating this profile.")
50 end 50 end
51 51
52 - redirect_to :controller => 'profile', :action => 'index' 52 + redirect_to profile.url
53 end 53 end
54 54
55 def create_rating_comment(rating) 55 def create_rating_comment(rating)
plugins/organization_ratings/test/functional/organization_ratings_plugin_profile_controller_test.rb
@@ -29,6 +29,13 @@ class OrganizationRatingsPluginProfileControllerTest &lt; ActionController::TestCas @@ -29,6 +29,13 @@ class OrganizationRatingsPluginProfileControllerTest &lt; ActionController::TestCas
29 assert_equal "#{@community.name} successfully rated!", session[:notice] 29 assert_equal "#{@community.name} successfully rated!", session[:notice]
30 end 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 test "Create community_rating without comment body" do 39 test "Create community_rating without comment body" do
33 post :new_rating, profile: @community.identifier, :comments => {:body => ""}, :organization_rating_value => 2 40 post :new_rating, profile: @community.identifier, :comments => {:body => ""}, :organization_rating_value => 2
34 41