diff --git a/app/views/cms/suggest_an_article.rhtml b/app/views/cms/suggest_an_article.rhtml index 9d55585..443ee4c 100644 --- a/app/views/cms/suggest_an_article.rhtml +++ b/app/views/cms/suggest_an_article.rhtml @@ -21,10 +21,10 @@ <%= _('Used when a short version of your text is needed.') %>
- <%= labelled_form_field(_('Lead'), text_area(:task , 'article_abstract', :style => 'width: 100%; height: 200px;')) %> + <%= labelled_form_field(_('Lead'), text_area(:task , 'article_abstract', :style => 'width: 100%; height: 200px;', :class => 'mceEditor')) %>
- <%= labelled_form_field(_('Text'), text_area(:task, 'article_body', :style => 'width:100%; height: 500px;')) %> + <%= labelled_form_field(_('Text'), text_area(:task, 'article_body', :style => 'width:100%; height: 500px;', :class => 'mceEditor')) %>
diff --git a/app/views/tasks/_suggest_article_accept_details.rhtml b/app/views/tasks/_suggest_article_accept_details.rhtml index 51aeea0..0577b72 100644 --- a/app/views/tasks/_suggest_article_accept_details.rhtml +++ b/app/views/tasks/_suggest_article_accept_details.rhtml @@ -1,3 +1,5 @@ +<%= render :file => 'shared/tiny_mce' %> + <%= labelled_form_field(_("Sent by: "), f.text_field(:name)) %>

<%= label_tag(_("Email: %s") % task.email) %>

<%= required labelled_form_field(_('Title'), f.text_field(:article_name, :size => 50)) %> @@ -8,10 +10,10 @@ <%= labelled_form_field(_('Highlight this article'), f.check_box(:highlighted)) %>
- <%= labelled_form_field(_('Lead'), f.text_area(:article_abstract, :style => 'width: 482px; height: 200px;')) %> + <%= labelled_form_field(_('Lead'), f.text_area(:article_abstract, :style => 'width: 482px; height: 200px;', :class => 'mceEditor')) %>
<%= _('Used when a short version your text is needed.') %>
- <%= labelled_form_field(_('Text'), f.text_area(:article_body, :style => 'width:482px; height: 500px;')) %> + <%= labelled_form_field(_('Text'), f.text_area(:article_body, :style => 'width:482px; height: 500px;', :class => 'mceEditor')) %>
diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index 755abdc..58006fa 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -1423,6 +1423,14 @@ class CmsControllerTest < Test::Unit::TestCase assert_template 'suggest_an_article' end + should 'render TinyMce Editor on suggestion of article' do + logout + get :suggest_an_article, :profile => profile.identifier + + assert_tag :tag => 'textarea', :attributes => { :name => /article_abstract/, :class => 'mceEditor' } + assert_tag :tag => 'textarea', :attributes => { :name => /article_body/, :class => 'mceEditor' } + end + should 'create a task suggest task to a profile' do c = Community.create!(:name => 'test comm', :identifier => 'test_comm', :moderated_articles => true) diff --git a/test/functional/tasks_controller_test.rb b/test/functional/tasks_controller_test.rb index 9b4948d..6e882dd 100644 --- a/test/functional/tasks_controller_test.rb +++ b/test/functional/tasks_controller_test.rb @@ -231,6 +231,19 @@ class TasksControllerTest < Test::Unit::TestCase assert_equal Task::Status::ACTIVE, task.status end + should 'render TinyMce Editor when approving suggested article task' do + Task.destroy_all + c = fast_create(Community) + c.add_admin profile + @controller.stubs(:profile).returns(c) + SuggestArticle.skip_captcha! + t = SuggestArticle.create!(:article_name => 'test name', :article_abstract => 'test abstract', :article_body => 'test body', :name => 'some name', :email => 'test@localhost.com', :target => c) + + get :index + assert_tag :tag => 'textarea', :content => 'test abstract', :attributes => { :name => /article_abstract/, :class => 'mceEditor' } + assert_tag :tag => 'textarea', :content => 'test body', :attributes => { :name => /article_body/, :class => 'mceEditor' } + end + should 'create TinyMceArticle article after finish approve suggested article task' do TinyMceArticle.destroy_all c = fast_create(Community) -- libgit2 0.21.2