moving features to min integrations
This commit is contained in:
parent
8653362bf1
commit
d277c97a57
@ -68,7 +68,6 @@ module Merged
|
|||||||
@section.allowed_fields.each do |key|
|
@section.allowed_fields.each do |key|
|
||||||
if( params.has_key?(key) )
|
if( params.has_key?(key) )
|
||||||
@section.update(key, params[key])
|
@section.update(key, params[key])
|
||||||
puts "updating:#{key}=#{params[key]}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
options = params[:option]
|
options = params[:option]
|
||||||
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
11
test/integration/changes_test.rb
Normal file
11
test/integration/changes_test.rb
Normal file
@ -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
|
19
test/integration/images_test.rb
Normal file
19
test/integration/images_test.rb
Normal file
@ -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
|
23
test/integration/page_test.rb
Normal file
23
test/integration/page_test.rb
Normal file
@ -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
|
11
test/integration/style_test.rb
Normal file
11
test/integration/style_test.rb
Normal file
@ -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
|
12
test/integration/view_test.rb
Normal file
12
test/integration/view_test.rb
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user