From 67b9265bba0986ff14c680615c1da2bdbad27135 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 17 May 2016 10:18:19 -0300 Subject: [PATCH] Rename blocks integration test file to avoid ambiguity with tests in api --- test/integration/blocks_test.rb | 46 ---------------------------------------------- test/integration/profile_blocks_test.rb | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 test/integration/blocks_test.rb create mode 100644 test/integration/profile_blocks_test.rb diff --git a/test/integration/blocks_test.rb b/test/integration/blocks_test.rb deleted file mode 100644 index a04749c..0000000 --- a/test/integration/blocks_test.rb +++ /dev/null @@ -1,46 +0,0 @@ -require_relative "../test_helper" - -class BlocksTest < ActionDispatch::IntegrationTest - - def blog_on_article_block_bootstrap - profile = fast_create(Profile) - blog = fast_create(Blog, :name => 'Blog', :profile_id => profile.id) - fast_create(TinyMceArticle, :name => "First Post", :profile_id => profile.id, :parent_id => blog.id, :body => '

Wasserstoffbombe

') - fast_create(TinyMceArticle, :name => "A Post", :profile_id => profile.id, :parent_id => blog.id, :body => '

Lorem ipsum dolor sit amet

Second paragraph

') - block = ArticleBlock.new - block.article = blog - profile.boxes << Box.new - profile.boxes.first.blocks << block - return block - end - - should 'allow blog as article block content' do - block = blog_on_article_block_bootstrap - get "/profile/#{block.owner.identifier}" - assert_match(/Lorem ipsum dolor sit amet/, @response.body) - end - - should 'display short version for block posts on article block' do - block = blog_on_article_block_bootstrap - get "/profile/#{block.owner.identifier}" - assert_no_match(/Second paragraph/, @response.body) - end - - should 'display full version for block posts on article block' do - block = blog_on_article_block_bootstrap - block.visualization_format = 'full' - block.save! - get "/profile/#{block.owner.identifier}" - assert_match(/Second paragraph/, @response.body) - end - - should 'display configured number of blog posts on article block' do - block = blog_on_article_block_bootstrap - block.posts_per_page = 2 - block.save! - get "/profile/#{block.owner.identifier}" - assert_match(/Lorem ipsum dolor sit amet/, @response.body) - assert_match(/Wasserstoffbombe/, @response.body) - end - -end diff --git a/test/integration/profile_blocks_test.rb b/test/integration/profile_blocks_test.rb new file mode 100644 index 0000000..eedae82 --- /dev/null +++ b/test/integration/profile_blocks_test.rb @@ -0,0 +1,46 @@ +require_relative "../test_helper" + +class ProfileBlocksTest < ActionDispatch::IntegrationTest + + def blog_on_article_block_bootstrap + profile = fast_create(Profile) + blog = fast_create(Blog, :name => 'Blog', :profile_id => profile.id) + fast_create(TinyMceArticle, :name => "First Post", :profile_id => profile.id, :parent_id => blog.id, :body => '

Wasserstoffbombe

') + fast_create(TinyMceArticle, :name => "A Post", :profile_id => profile.id, :parent_id => blog.id, :body => '

Lorem ipsum dolor sit amet

Second paragraph

') + block = ArticleBlock.new + block.article = blog + profile.boxes << Box.new + profile.boxes.first.blocks << block + return block + end + + should 'allow blog as article block content' do + block = blog_on_article_block_bootstrap + get "/profile/#{block.owner.identifier}" + assert_match(/Lorem ipsum dolor sit amet/, @response.body) + end + + should 'display short version for block posts on article block' do + block = blog_on_article_block_bootstrap + get "/profile/#{block.owner.identifier}" + assert_no_match(/Second paragraph/, @response.body) + end + + should 'display full version for block posts on article block' do + block = blog_on_article_block_bootstrap + block.visualization_format = 'full' + block.save! + get "/profile/#{block.owner.identifier}" + assert_match(/Second paragraph/, @response.body) + end + + should 'display configured number of blog posts on article block' do + block = blog_on_article_block_bootstrap + block.posts_per_page = 2 + block.save! + get "/profile/#{block.owner.identifier}" + assert_match(/Lorem ipsum dolor sit amet/, @response.body) + assert_match(/Wasserstoffbombe/, @response.body) + end + +end -- libgit2 0.21.2