diff --git a/app/controllers/my_profile/profile_editor_controller.rb b/app/controllers/my_profile/profile_editor_controller.rb index b7335ca..2eb3014 100644 --- a/app/controllers/my_profile/profile_editor_controller.rb +++ b/app/controllers/my_profile/profile_editor_controller.rb @@ -18,7 +18,6 @@ class ProfileEditorController < MyProfileController @profile_data = profile @possible_domains = profile.possible_domains if request.post? - puts "$"*80, params[:profile_data] params[:profile_data][:fields_privacy] ||= {} if profile.person? && params[:profile_data].is_a?(Hash) Profile.transaction do Image.transaction do diff --git a/plugins/profile_description_block/test/unit/profile_description_block_test.rb b/plugins/profile_description_block/test/unit/profile_description_block_test.rb new file mode 100644 index 0000000..584d5b4 --- /dev/null +++ b/plugins/profile_description_block/test/unit/profile_description_block_test.rb @@ -0,0 +1,29 @@ +require File.expand_path(File.dirname(__FILE__) + "/../../../../test/test_helper") + +class ProfileDescriptionBlockTest < ActiveSupport::TestCase + def setup + e = Environment.default + e.enabled_plugins = ['ProfileDescriptionPlugin'] + @person = create_user('test_user').person + @profile = Profile.create!(:identifier => '1236', + :name => 'blabla', + :description => "") + end + + should 'describe itself' do + assert_not_equal Block.description, ProfileDescriptionBlock.description + end + + should "show profile description inside block" do + new_block = ProfileDescriptionBlock.create! + @profile.boxes.first.blocks << new_block + block_menssage = "Description field are empty" + assert (instance_eval(&Block.last.content).include?(block_menssage)), + "description block doesn't show not found description message" + description = "This is an test" + @profile.update_attribute("description", description) + @profile.save! + assert (instance_eval(&Block.last.content).include?(description)), + "Description block doesn't show profile description" + end +end diff --git a/plugins/profile_description_block/views/blocks/profile_description.html.erb b/plugins/profile_description_block/views/blocks/profile_description.html.erb index 6623010..95f1d65 100644 --- a/plugins/profile_description_block/views/blocks/profile_description.html.erb +++ b/plugins/profile_description_block/views/blocks/profile_description.html.erb @@ -3,6 +3,6 @@ <%= block.title %>
- <%= description %> + <%= description %>
diff --git a/test/unit/article_block_test.rb b/test/unit/article_block_test.rb index 038f357..a1ebc02 100644 --- a/test/unit/article_block_test.rb +++ b/test/unit/article_block_test.rb @@ -1,7 +1,6 @@ require_relative "../test_helper" class ArticleBlockTest < ActiveSupport::TestCase - include ApplicationHelper should 'describe itself' do -- libgit2 0.21.2