test harness is back, and pages fixed after refactor

This commit is contained in:
2022-12-08 17:16:29 +02:00
parent a8aa16170a
commit 308b9e1d2e
22 changed files with 257 additions and 23 deletions

View File

@ -0,0 +1,11 @@
require 'rails_helper'
RSpec.feature "Changes", type: :feature do
describe "GET /changes" do
it "returns http success" do
visit "/merged/changes"
expect(page).to have_title("Merged")
expect(page).to have_text("Pages")
end
end
end

View File

@ -0,0 +1,11 @@
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("Merged")
expect(page).to have_text("Pages")
end
end
end

View File

@ -0,0 +1,17 @@
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("Merged")
expect(page).to have_text("Pages")
end
end
describe "index page" do
it "returns http success" do
visit "/merged/pages"
click_on ("index")
end
end
end

View File

@ -0,0 +1,19 @@
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")
find_link("Edit").click
end
end
end

View File

@ -0,0 +1,11 @@
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("Merged")
expect(page).to have_text("Pages")
end
end
end

View File

@ -0,0 +1,17 @@
require 'rails_helper'
module Merged
RSpec.describe Option, type: :model do
let(:first) {Option.options.values.first}
it "has Option.options" do
expect(Option.options.class).to be Hash
end
it "there are options" do
expect(Option.options.length).to be 12
end
it "has option objects" do
expect(first.class).to be Option
end
end
end

View File

@ -1,3 +1,4 @@
require 'capybara/rspec'
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause