diff --git a/app/controllers/merged/sections_controller.rb b/app/controllers/merged/sections_controller.rb index 56c9e12..c983941 100644 --- a/app/controllers/merged/sections_controller.rb +++ b/app/controllers/merged/sections_controller.rb @@ -68,7 +68,6 @@ module Merged @section.allowed_fields.each do |key| if( params.has_key?(key) ) @section.update(key, params[key]) - puts "updating:#{key}=#{params[key]}" end end options = params[:option] diff --git a/spec/features/merged/changes_spec.rb b/spec/features/merged/changes_spec.rb deleted file mode 100644 index a8b74bf..0000000 --- a/spec/features/merged/changes_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'rails_helper' - -RSpec.feature "Changes", type: :feature do - describe "GET /changes" do - it "returns http success" do -# visit "/merged/changes/index" -# expect(page).to have_title("Deletions") -# expect(page).to have_text("Additions") - end - end -end diff --git a/spec/features/merged/images_spec.rb b/spec/features/merged/images_spec.rb deleted file mode 100644 index 5142b92..0000000 --- a/spec/features/merged/images_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'rails_helper' - -RSpec.feature "Images", type: :feature do - describe "GET /images" do - it "returns http success" do - visit "/merged/images" - expect(page).to have_title("Dummy") - expect(page).to have_text("Pages") - end - it "has picures" , js: true do - expexted_num = Merged::Image.count - visit "/merged/images" - found= find_all(".image_box").count - expect(found).to be expexted_num - end - end -end diff --git a/spec/features/merged/page_spec.rb b/spec/features/merged/page_spec.rb deleted file mode 100644 index a1a448b..0000000 --- a/spec/features/merged/page_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'rails_helper' - -RSpec.feature "Pages", type: :feature do - describe "GET /pages" do - it "returns http success" do - visit "/merged/pages" - expect(page).to have_title("Dummy") - expect(page).to have_text("Pages") - end - - it "has an index page" do - visit "/merged/pages" - click_on ("index") - end - - it "edit page works " do - visit "/merged/pages" - within("#index") do - click_on ("Edit") - end - end - end -end diff --git a/spec/features/merged/section_spec.rb b/spec/features/merged/section_spec.rb deleted file mode 100644 index 598fee2..0000000 --- a/spec/features/merged/section_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'rails_helper' - -RSpec.feature "Sections", type: :feature do - describe "index page" do - it "returns http success" do - visit "/merged/pages" - click_on ("index") - expect(page).to have_text("index") - expect(page).to have_text("Section 1") - end - end - describe "show page" do - it "returns http success" do - visit "/merged/pages" - click_on ("index") - within("#section_31") do - find_link("Edit").click - end - end - - describe "show page" do - it "returns http success" do - visit "/merged/pages" - click_on ("index") - within("#section_31") do - find_link("Edit").click - end - end - end - end -end diff --git a/spec/features/merged/style_spec.rb b/spec/features/merged/style_spec.rb deleted file mode 100644 index 0a2d517..0000000 --- a/spec/features/merged/style_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'rails_helper' - -RSpec.feature "Styles", type: :feature do - describe "GET /styles" do - it "returns http success" do - visit "/merged/styles/index" - expect(page).to have_title("Dummy") - expect(page).to have_text("Styles") - end - end -end diff --git a/spec/features/merged/view_spec.rb b/spec/features/merged/view_spec.rb deleted file mode 100644 index 24bc112..0000000 --- a/spec/features/merged/view_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'rails_helper' - -RSpec.feature "View", type: :feature do - describe "Check rendering" do - - it "returns http successfor all pages" do - Merged::Page.all.each do |page| - visit "/" + page.name - end - end - end -end diff --git a/test/integration/changes_test.rb b/test/integration/changes_test.rb new file mode 100644 index 0000000..68d0106 --- /dev/null +++ b/test/integration/changes_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class ChangesTest < ActionDispatch::IntegrationTest + include Devise::Test::IntegrationHelpers # Rails >= 5 + + def test_index + # visit "/merged/changes/index" + # assert_equal page, have_title("Deletions") + # assert_equal page, have_text("Additions") + end +end diff --git a/test/integration/images_test.rb b/test/integration/images_test.rb new file mode 100644 index 0000000..9585aa4 --- /dev/null +++ b/test/integration/images_test.rb @@ -0,0 +1,19 @@ +require "test_helper" + +class ImagesTest < ActionDispatch::IntegrationTest + include Devise::Test::IntegrationHelpers # Rails >= 5 + + def test_index + visit "/merged/images" + assert_title page, "Dummy" + assert_text page, "Pages" + end + + def test_has_picures + Capybara.current_driver = :selenium_headless # js: true + expexted_num = Merged::Image.count + visit "/merged/images" + found= find_all(".image_box").count + assert_equal found, expexted_num + end +end diff --git a/test/integration/page_test.rb b/test/integration/page_test.rb new file mode 100644 index 0000000..1594df9 --- /dev/null +++ b/test/integration/page_test.rb @@ -0,0 +1,23 @@ +require "test_helper" + +class PageTest < ActionDispatch::IntegrationTest + include Devise::Test::IntegrationHelpers # Rails >= 5 + + def test_returns_success + visit "/merged/pages" + assert_title page, "Dummy" + assert_text page, "Pages" + end + + def test_has_an_index_page + visit "merged/pages" + click_on ("index") + end + + def test_edit_page_works + visit "/merged/pages" + within("#index") do + click_on ("Edit") + end + end +end diff --git a/test/integration/style_test.rb b/test/integration/style_test.rb new file mode 100644 index 0000000..3ebbf76 --- /dev/null +++ b/test/integration/style_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class StylesTest < ActionDispatch::IntegrationTest + include Devise::Test::IntegrationHelpers # Rails >= 5 + + def test_returns_success + visit "/merged/styles/index" + assert_title page, "Dummy" + assert_text page, "Styles" + end +end diff --git a/test/integration/view_test.rb b/test/integration/view_test.rb new file mode 100644 index 0000000..a31468d --- /dev/null +++ b/test/integration/view_test.rb @@ -0,0 +1,12 @@ +require "test_helper" + +class ViewTest < ActionDispatch::IntegrationTest + include Devise::Test::IntegrationHelpers # Rails >= 5 + + def test_returns_ok_all_pages + Merged::Page.all.each do |page| + visit "/" + page.name + assert_equal "/#{current_path}" , page.name + end + end +end