-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove last bits of jquery. Move all js function into fba.js * update to ruby 3.1.1
- Loading branch information
1 parent
7c17b53
commit bd37c0d
Showing
22 changed files
with
137 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import "./controllers" | ||
|
||
console.log("Rails application js"); | ||
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails | ||
//= require controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// This file is auto-generated by ./bin/rails stimulus:manifest:update | ||
// Run that command whenever you add a new controller or create them with | ||
// ./bin/rails generate stimulus controllerName | ||
// Import and register all your controllers from the importmap under controllers/* | ||
|
||
import { application } from "./application" | ||
import { application } from "controllers/application" | ||
|
||
import HelloController from "./hello_controller" | ||
application.register("hello", HelloController) | ||
// Eager load all controllers defined in the import map under controllers/**/*_controller | ||
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" | ||
eagerLoadControllersFrom("controllers", application) | ||
|
||
// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) | ||
// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" | ||
// lazyLoadControllersFrom("controllers", application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require_relative "../config/application" | ||
require "importmap/commands" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Pin npm packages by running ./bin/importmap | ||
|
||
pin "application", preload: true | ||
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true | ||
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true | ||
pin_all_from "app/javascript/controllers", under: "controllers" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
context "SPAMBOT" do | ||
before do | ||
visit touchpoint_path(form) | ||
page.execute_script("$('#fba_directive').val('SPAM Text')") | ||
page.execute_script("document.getElementById('fba_directive').value = 'SPAM Text'") | ||
click_button "Submit" | ||
end | ||
|
||
|
@@ -123,7 +123,6 @@ | |
all('.usa-checkbox__label').each do |checkbox_label| | ||
checkbox_label.click | ||
end | ||
|
||
inputs = find_all("input") | ||
inputs.first.set("hi") | ||
inputs.last.set("bye") | ||
|
@@ -299,14 +298,14 @@ | |
|
||
it "allows valid email address" do | ||
fill_in "answer_03", with: "[email protected]" | ||
find("#answer_03").native.send_key :tab | ||
expect(find("#answer_03").value).to eq("[email protected]") | ||
click_button "Submit" | ||
expect(page).to have_content("Thank you. Your feedback has been received.") | ||
end | ||
|
||
it "disallows invalid text input" do | ||
fill_in "answer_03", with: "test@testcom" | ||
find("#answer_03").native.send_key :tab | ||
expect(page).to have_content("Please enter a valid email") | ||
click_button "Submit" | ||
expect(page).to have_content("Please enter a valid value: Email") | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,72 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Collection, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
describe "required attributes" do | ||
context "newly created Collection" do | ||
before do | ||
@collection = Collection.create({}) | ||
end | ||
|
||
it "requires user" do | ||
expect(@collection.errors.messages).to have_key(:user) | ||
expect(@collection.errors.messages[:user]).to eq(["must exist"]) | ||
end | ||
|
||
it "requires organization" do | ||
expect(@collection.errors.messages).to have_key(:organization) | ||
expect(@collection.errors.messages[:organization]).to eq(["must exist"]) | ||
end | ||
|
||
it "requires service_provider" do | ||
expect(@collection.errors.messages).to have_key(:service_provider) | ||
expect(@collection.errors.messages[:service_provider]).to eq(["must exist"]) | ||
end | ||
|
||
it "requires name" do | ||
expect(@collection.errors.messages).to have_key(:name) | ||
expect(@collection.errors.messages[:name]).to eq(["can't be blank"]) | ||
end | ||
|
||
it "requires year" do | ||
expect(@collection.errors.messages).to have_key(:year) | ||
expect(@collection.errors.messages[:year]).to eq(["can't be blank"]) | ||
end | ||
|
||
it "requires quarter" do | ||
expect(@collection.errors.messages).to have_key(:quarter) | ||
expect(@collection.errors.messages[:quarter]).to eq(["can't be blank"]) | ||
end | ||
|
||
end | ||
end | ||
|
||
let(:organization) { FactoryBot.create(:organization) } | ||
let(:user) { FactoryBot.create(:user, organization: organization) } | ||
let(:service_provider) { FactoryBot.create(:service_provider, organization: organization) } | ||
|
||
describe "a minimally valid Collection" do | ||
before do | ||
@collection = Collection.create(name: "Test Collection", organization: organization, user: user, service_provider: service_provider, year: 2022, quarter: 2) | ||
end | ||
|
||
it "requires user" do | ||
expect(@collection.valid?).to eq(true) | ||
end | ||
end | ||
|
||
describe "reflection text that is too long" do | ||
context do | ||
before do | ||
reflection_text = "longstring" * 600 # 6,000 char string | ||
@collection = Collection.create(name: "Test Collection", organization: organization, user: user, service_provider: service_provider, year: 2022, quarter: 2, reflection: reflection_text) | ||
end | ||
|
||
it "adds error, indicating 5000 character limit" do | ||
expect(@collection.valid?).to eq(false) | ||
expect(@collection.errors.messages[:reflection].first).to eq("is too long (maximum is 5000 characters)") | ||
end | ||
|
||
end | ||
end | ||
|
||
end |
Empty file.