source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/bullet.rb | Ruby | bsd-3-clause | 187 | master | 242 | RSpec.configure do |config|
if Bullet.enable?
config.before do
Bullet.start_request
end
config.after do
Bullet.perform_out_of_channel_notifications if Bullet.notification?
Bullet.end_request
end
end
end |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/geocoder_stubs.rb | Ruby | bsd-3-clause | 187 | master | 2,195 | Geocoder.configure(lookup: :test)
Geocoder::Lookup::Test.add_stub(
'94403', [
{
'coordinates' => [37.5349925, -122.3050823],
'address' => 'San Mateo, CA 94403, USA',
'state' => 'California',
'state_code' => 'CA',
'country' => 'United States',
'country_code' => 'US'
}
]
)... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/database_cleaner.rb | Ruby | bsd-3-clause | 187 | master | 368 | RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end
config.before do
DatabaseCleaner.start
end
conf... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/capybara.rb | Ruby | bsd-3-clause | 187 | master | 651 | require 'webdrivers/chromedriver'
require 'selenium/webdriver'
Capybara.configure do |config|
config.default_max_wait_time = 5
config.always_include_port = true
end
Capybara.register_driver :headless_chrome do |app|
browser_options = Selenium::WebDriver::Chrome::Options.new
browser_options.add_argument('--hea... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/request_helpers.rb | Ruby | bsd-3-clause | 187 | master | 217 | module Requests
# This module allows you to use 'json' within specs as a shortcut for
# 'JSON.parse(response.body)'
module RequestHelpers
def json
@json ||= JSON.parse(response.body)
end
end
end |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/features/schedule_helpers.rb | Ruby | bsd-3-clause | 187 | master | 2,707 | module Features
module ScheduleHelpers
def add_hour(options = {})
click_link I18n.t('admin.buttons.add_hours_of_operation')
update_hours(options)
end
def update_hours(options = {})
within('.hours') do
select(options[:weekday], from: weekday) if options[:weekday]
select_o... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/features/session_helpers.rb | Ruby | bsd-3-clause | 187 | master | 2,687 | module Features
# Helper methods you can use in specs to perform common and
# repetitive actions.
module SessionHelpers
def login_admin
@admin = FactoryBot.create(:admin)
login_as(@admin, scope: :admin)
end
def login_as_admin(admin)
login_as(admin, scope: :admin)
end
def lo... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/features/contact_helpers.rb | Ruby | bsd-3-clause | 187 | master | 948 | module Features
module ContactHelpers
def add_contact(options = {})
click_link I18n.t('admin.buttons.add_contact')
update_contact(options)
end
def update_contact(options = {})
within('.contacts') do
fill_in name, with: options[:name]
fill_in title, with: options[:title]
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/features/phone_helpers.rb | Ruby | bsd-3-clause | 187 | master | 1,257 | module Features
module PhoneHelpers
def add_phone(options = {})
click_link I18n.t('admin.buttons.add_phone')
update_phone(options)
end
def update_phone(options = {})
within('.phones') do
fill_in_phone_text_fields(options)
select(options[:number_type], from: number_type) ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/features/form_helpers.rb | Ruby | bsd-3-clause | 187 | master | 6,385 | module Features
module FormHelpers
def reset_accessibility
within('.accessibility') do
all('input[type=checkbox]').each do |checkbox|
uncheck checkbox[:id]
end
end
click_button I18n.t('admin.buttons.save_changes')
end
def set_all_accessibility
within('.ac... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/support/shared_contexts/rake.rb | Ruby | bsd-3-clause | 187 | master | 597 | require 'rake'
shared_context 'rake' do
subject { rake[task_name] }
let(:rake) { Rake::Application.new }
let(:task_name) { self.class.top_level_description }
let(:task_path) { "lib/tasks/#{task_name.split(':').first}" }
def loaded_files_excluding_current_rake_file
$LOADED_FEATURES.reject {... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/users.rb | Ruby | bsd-3-clause | 187 | master | 665 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :user do
name { 'Test User' }
email { 'valid@example.com' }
password { 'mong01dtest' }
password_confirmation { 'mong01dtest' }
# required if the Devise Confirmable module is used
confirmed_at { T... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/contacts.rb | Ruby | bsd-3-clause | 187 | master | 418 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :contact do
name { 'Moncef Belyamani' }
title { 'CTO' }
factory :foobar do
name { 'Foo' }
title { 'Bar' }
end
factory :contact_with_extra_whitespace do
name { 'Foo ' }
title... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/phones.rb | Ruby | bsd-3-clause | 187 | master | 429 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :phone do
number { '650 851-1210' }
number_type { 'voice' }
extension { '200' }
end
factory :phone_with_extra_whitespace, class: 'Phone' do
country_prefix { '33 ' }
number { '650 851-1210 ' }
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/api_applications.rb | Ruby | bsd-3-clause | 187 | master | 336 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :api_application do
name { 'test app' }
main_url { 'http://cfa.org' }
callback_url { 'http://cfa.org/callback' }
factory :app_with_extra_whitespace do
name { ' app with extra whitespace ' }
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/addresses.rb | Ruby | bsd-3-clause | 187 | master | 1,039 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :address do
address_1 { '1800 Easton Drive' }
city { 'Burlingame' }
state_province { 'CA' }
postal_code { '94010' }
country { 'US' }
end
factory :near, class: 'Address' do
address_1 { '250 M... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/services.rb | Ruby | bsd-3-clause | 187 | master | 1,022 | FactoryBot.define do
factory :service do
name { 'Literacy Program' }
description { 'yoga classes' }
application_process { 'By phone.' }
keywords { ['library', 'food pantries', 'stood famps', 'emergency'] }
status { 'active' }
location
end
factory :service_with_extra_whitespace, class: 'Se... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/categories.rb | Ruby | bsd-3-clause | 187 | master | 356 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :category do
name { 'Food' }
taxonomy_id { '101' }
end
factory :health, class: 'Category' do
name { 'Health' }
taxonomy_id { '102' }
end
factory :jobs, class: 'Category' do
name { 'Jobs' }
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/holiday_schedules.rb | Ruby | bsd-3-clause | 187 | master | 262 | FactoryBot.define do
factory :holiday_schedule do
closed { true }
start_date { 'December 24, 2014' }
end_date { 'December 24, 2014' }
trait :open do
closed { false }
opens_at { '9am' }
closes_at { '17:00' }
end
end
end |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/mail_addresses.rb | Ruby | bsd-3-clause | 187 | master | 596 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :mail_address do
attention { 'Monfresh' }
address_1 { '1 davis dr' }
city { 'Belmont' }
state_province { 'CA' }
postal_code { '90210' }
country { 'US' }
association :location, factory: :no_ad... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/locations.rb | Ruby | bsd-3-clause | 187 | master | 3,134 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :location do
name { 'VRS Services' }
description { 'Provides jobs training' }
short_desc { 'short description' }
accessibility { %i[tape_braille disabled_parking] }
latitude { 37.583939 }
longitu... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/organizations.rb | Ruby | bsd-3-clause | 187 | master | 1,317 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :organization do
name { 'Parent Agency' }
description { 'Organization created for testing purposes' }
end
factory :nearby_org, class: 'Organization' do
name { 'Food Stamps' }
description { 'Organiza... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/factories/admins.rb | Ruby | bsd-3-clause | 187 | master | 1,031 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryBot.define do
factory :admin do
name { 'Org Admin' }
email { 'moncef@samaritanhouse.com' }
password { 'ohanatest' }
password_confirmation { 'ohanatest' }
confirmed_at { Time.zone.now }
factory :super_admin do
na... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/regular_schedule_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,300 | require 'rails_helper'
describe RegularScheduleImporter do
subject(:importer) { RegularScheduleImporter.new(content) }
let(:invalid_content) do
Rails.root.join('spec/support/fixtures/invalid_regular_schedule.csv')
end
let(:valid_content) do
Rails.root.join('spec/support/fixtures/valid_location_regular... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/service_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,514 | require 'rails_helper'
describe ServiceImporter do
subject(:importer) { ServiceImporter.new(content) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_service.csv') }
let(:invalid_location) do
Rails.root.join('spec/support/fixtures/invalid_service_location.csv')
end
let(:valid_con... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/phone_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,318 | require 'rails_helper'
describe PhoneImporter do
subject(:importer) { PhoneImporter.new(content) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_phone.csv') }
let(:valid_content) { Rails.root.join('spec/support/fixtures/valid_location_phone.csv') }
let(:valid_service_phone) do
Rai... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/contact_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,718 | require 'rails_helper'
describe ContactImporter do
subject(:importer) { ContactImporter.new(content) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_contact.csv') }
let(:valid_content) do
Rails.root.join('spec/support/fixtures/valid_location_contact.csv')
end
let(:valid_service_... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/program_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 3,586 | require 'rails_helper'
describe ProgramImporter do
subject(:importer) { ProgramImporter.new(content) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_program.csv') }
let(:valid_content) { Rails.root.join('spec/support/fixtures/valid_program.csv') }
let(:no_parent) { Rails.root.join('sp... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/service_presenter_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,718 | require 'rails_helper'
describe ServicePresenter do
subject(:presenter) { ServicePresenter.new(properties) }
before(:all) do
DatabaseCleaner.clean_with(:truncation)
create(:location)
end
after(:all) do
Organization.find_each(&:destroy)
end
let(:properties) do
{
id: '1',
locat... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/file_checker_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,640 | require 'rails_helper'
describe FileChecker do
subject(:checker) { FileChecker.new(path, required_headers) }
let(:required_and_full) { Rails.root.join('spec/support/fixtures/locations.csv') }
let(:required_but_empty) { Rails.root.join('spec/support/fixtures/services.csv') }
let(:required_but_missing) { Rails.... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/organization_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,146 | require 'rails_helper'
describe OrganizationImporter do
subject(:importer) { OrganizationImporter.new(content) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_org.csv') }
let(:invalid_date) do
Rails.root.join('spec/support/fixtures/org_with_invalid_date.csv')
end
let(:valid_cont... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/category_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 3,661 | require 'rails_helper'
describe CategoryImporter do
subject(:importer) { CategoryImporter.new(content) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_category.csv') }
let(:invalid_parent) do
Rails.root.join('spec/support/fixtures/invalid_parent_category.csv')
end
let(:valid_con... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/api_constraints_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,057 | require 'active_record'
require 'support/api_constraints_spec_helper'
require_relative '../../lib/api_constraints'
describe ApiConstraints do
let(:request) { double :request }
describe '#matches?' do
it 'matches requests including the versioned vendor mime type' do
constraint = described_class.new(versi... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/importer_errors_spec.rb | Ruby | bsd-3-clause | 187 | master | 663 | require 'spec_helper'
describe ImporterErrors do
subject(:importer_errors) { ImporterErrors.new(invalid, 6) }
let(:errors) { double(:errors, full_messages: ['not enough cowbell']) }
let(:invalid) { double(:record, valid?: false, errors: errors) }
its(:line_number) { is_expected.to eq 6 }
its(:message) { is... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/address_extractor_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,362 | require 'rails_helper'
describe AddressExtractor do
describe '.extract_addresses' do
context 'with valid data' do
it 'extracts the addresses' do
address_hash = {
id: '1',
location_id: '2',
address_1: '123 Main Street',
address_2: 'Suite 101',
city: ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/location_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 7,679 | require 'rails_helper'
describe LocationImporter do
subject(:importer) { LocationImporter.new(content, address) }
let(:invalid_content) { Rails.root.join('spec/support/fixtures/invalid_location.csv') }
let(:invalid_org) { Rails.root.join('spec/support/fixtures/invalid_location_org.csv') }
let(:valid_content) ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/default_host_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,191 | require 'rails_helper'
describe DefaultHost do
describe '#call' do
context 'heroku domain' do
it 'only allows the configured domain name' do
allow(Figaro.env).to receive(:domain_name).and_return('app.herokuapp.com')
request = double(host: 'foo.herokuapp.com')
expect(DefaultHost.new... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/location_presenter_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,548 | require 'rails_helper'
describe LocationPresenter do
subject(:presenter) { LocationPresenter.new(properties, addresses) }
before(:all) do
DatabaseCleaner.clean_with(:truncation)
create(:organization)
end
after(:all) do
Organization.find_each(&:destroy)
end
let(:properties) do
{
org... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/asset_hosts_spec.rb | Ruby | bsd-3-clause | 187 | master | 2,672 | require 'rails_helper'
describe AssetHosts do
describe '#call' do
let(:request_with_port) { double(host: 'example.com', port: '3000') }
let(:request_with_subdomain_and_port) do
double(host: 'admin.example.com', port: '3000')
end
let(:request) { double(host: 'example.com', port: nil) }
let(:... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/config_validator_spec.rb | Ruby | bsd-3-clause | 187 | master | 933 | require 'rails_helper'
describe ConfigValidator do
describe '#validate' do
let(:invalid_env) do
{
'ASSET_HOST' => '',
'DEFAULT_PER_PAGE' => '',
'DOMAIN_NAME' => '',
'MAX_PER_PAGE' => ''
}
end
let(:valid_env) do
{
'ASSET_HOST' => 'lvh.me',
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/organization_presenter_spec.rb | Ruby | bsd-3-clause | 187 | master | 2,647 | require 'rails_helper'
describe OrganizationPresenter do
subject(:presenter) { OrganizationPresenter.new(properties) }
let(:properties) do
{
id: 1,
name: 'Parent Agency',
description: 'Example description'
}
end
describe '#to_org' do
context 'when the org is valid' do
it '... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/mail_address_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,107 | require 'rails_helper'
describe MailAddressImporter do
subject(:importer) { MailAddressImporter.new(content) }
let(:invalid_content) do
Rails.root.join('spec/support/fixtures/invalid_mail_address.csv')
end
let(:invalid_location) do
Rails.root.join('spec/support/fixtures/invalid_mail_address_location.c... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/holiday_schedule_importer_spec.rb | Ruby | bsd-3-clause | 187 | master | 6,016 | require 'rails_helper'
describe HolidayScheduleImporter do
subject(:importer) { HolidayScheduleImporter.new(content) }
let(:invalid_content) do
Rails.root.join('spec/support/fixtures/invalid_holiday_schedule.csv')
end
let(:invalid_date) { Rails.root.join('spec/support/fixtures/hs_with_invalid_date.csv') }... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/lib/tasks/remove_test_users_and_admins_rake_spec.rb | Ruby | bsd-3-clause | 187 | master | 901 | require 'rails_helper'
describe 'remove_test_users_and_admins' do
include_context 'rake'
before do
create(:user)
create(:admin)
allow_any_instance_of(IO).to receive(:puts)
Rails.application.load_seed
end
its(:prerequisites) { is_expected.to include('environment') }
it 'only removes 2 users... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/delete_api_application_spec.rb | Ruby | bsd-3-clause | 187 | master | 560 | require 'rails_helper'
describe 'Delete an API Application' do
before do
user = create(:user_with_app)
login_as(user, scope: :user)
name = user.api_applications.first.name
main_url = user.api_applications.first.main_url
visit_app(name, main_url)
end
it 'deletes the application when the delet... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/signup_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,760 | require 'rails_helper'
describe 'Signing up' do
it 'with all required fields present and valid' do
sign_up('Moncef', 'moncef@foo.com', 'ohanatest', 'ohanatest')
expect(page).to have_content 'activate your account'
expect(page).not_to have_content('Admin')
expect(page).to have_current_path(new_user_se... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/homepage_text_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,621 | require 'rails_helper'
describe 'Visit home page after signing in' do
# The 'login_as' method is a Warden test helper that
# allows you to simulate a user login without having
# to fill in the sign in form every time. Since we're
# not testing the signing in part of the app here, we
# can take advantage of t... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/update_api_application_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,463 | require 'rails_helper'
describe 'Update an existing API Application' do
# The 'visit_app' and 'update_api_app' methods are defined in
# spec/support/features/session_helpers.rb
# The 'login_as' method is a Warden test helper that
# allows you to simulate a user login without having
# to fill in the sign in ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/sign_out_spec.rb | Ruby | bsd-3-clause | 187 | master | 288 | require 'rails_helper'
describe 'Signing out' do
before do
login_user
visit edit_user_registration_path
end
it 'redirects to the user home page' do
click_link I18n.t('navigation.sign_out')
expect(page).to have_current_path(root_path, ignore_query: true)
end
end |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/signin_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,041 | require 'rails_helper'
describe 'Signing in' do
# The 'sign_in' method is defined in spec/support/features/session_helpers.rb
context 'with correct credentials' do
before do
valid_user = create(:user)
sign_in(valid_user.email, valid_user.password)
end
it 'redirects to developer portal home... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/edit_account_spec.rb | Ruby | bsd-3-clause | 187 | master | 725 | require 'rails_helper'
describe 'Editing User account' do
before do
login_user
visit edit_user_registration_path
end
it 'allows the name to be changed' do
fill_in 'user_name', with: 'New User name'
fill_in 'user_current_password', with: @user.password
click_button I18n.t('buttons.update')
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/create_new_api_application_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,859 | require 'rails_helper'
describe 'Creating a new API Application' do
# The 'create_api_app' method is defined in
# spec/support/features/session_helpers.rb
# The 'login_as' method is a Warden test helper that
# allows you to simulate a user login without having
# to fill in the sign in form every time. Since... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/edit_account_spec.rb | Ruby | bsd-3-clause | 187 | master | 711 | require 'rails_helper'
describe 'Editing Admin account' do
before do
login_admin
visit '/admin/edit'
end
it 'allows the name to be changed' do
fill_in 'admin_name', with: 'New Admin name'
fill_in 'admin_current_password', with: @admin.password
click_button I18n.t('buttons.update')
visit ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/sign_out_spec.rb | Ruby | bsd-3-clause | 187 | master | 307 | require 'rails_helper'
describe 'Signing out' do
before do
login_admin
visit edit_admin_registration_path
end
it 'redirects to the admin sign in page' do
click_link I18n.t('navigation.sign_out')
expect(page).to have_current_path(new_admin_session_path, ignore_query: true)
end
end |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/dashboard_spec.rb | Ruby | bsd-3-clause | 187 | master | 6,752 | require 'rails_helper'
describe 'Admin Home page' do
context 'when not signed in' do
before do
visit '/admin'
end
it 'sets the current path to the admin sign in page' do
expect(page).to have_current_path(new_admin_session_path, ignore_query: true)
end
it 'includes a link to the sign... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/sign_up_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,874 | require 'rails_helper'
describe 'Signing up for a new admin account' do
it 'with all required fields present and valid' do
sign_up_admin('Moncef', 'moncef@foo.com', 'ohanatest', 'ohanatest')
expect(page).to have_content 'activate your account'
expect(page).to have_content('Admin')
expect(page).to hav... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/sign_in_spec.rb | Ruby | bsd-3-clause | 187 | master | 2,712 | require 'rails_helper'
describe 'Visiting the Sign in page' do
before do
visit new_admin_session_path
end
it 'includes a link to the sign in page in the navigation' do
within '.navbar' do
expect(page).not_to have_link I18n.t('navigation.sign_in'), href: new_admin_session_path
end
end
it '... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_website_spec.rb | Ruby | bsd-3-clause | 187 | master | 706 | require 'rails_helper'
describe 'Update website' do
before do
@org = create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with invalid website' do
fill_in 'organization_website', with: 'www.monfresh.com'
click_button I18n.t('admin.buttons.save_changes')
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_tax_status_spec.rb | Ruby | bsd-3-clause | 187 | master | 391 | require 'rails_helper'
describe 'Update tax status' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with tax status' do
fill_in 'organization_tax_status', with: '501(c)(3)'
click_button I18n.t('admin.buttons.save_changes')
expect(fi... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_licenses_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,280 | require 'rails_helper'
describe 'Update licenses' do
before do
@organization = create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'when no licenses exist', :js do
within '#s2id_organization_licenses' do
expect(page).to have_no_css('.select2-search-cho... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_date_incorporated_spec.rb | Ruby | bsd-3-clause | 187 | master | 663 | require 'rails_helper'
describe 'Update date incorporated' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with date incorporated' do
select_date(Time.zone.today, from: 'organization_date_incorporated')
click_button I18n.t('admin.button... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_accreditations_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,365 | require 'rails_helper'
describe 'Update accreditations' do
before do
@organization = create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'when no accreditations exist', :js do
within '#s2id_organization_accreditations' do
expect(page).to have_no_css('.... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/visit_organization_spec.rb | Ruby | bsd-3-clause | 187 | master | 2,426 | require 'rails_helper'
describe 'Visiting a specific organization' do
before(:all) do
@location = create(:location)
@organization = @location.organization
end
before do
@organization.reload
@location.reload
end
after(:all) do
Organization.find_each(&:destroy)
end
it 'when admin has... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/visit_organizations_spec.rb | Ruby | bsd-3-clause | 187 | master | 2,180 | require 'rails_helper'
describe 'Organizations page' do
context 'when not signed in' do
before do
visit '/admin/organizations'
end
it 'redirects to the admin sign in page' do
expect(page).to have_current_path(new_admin_session_path, ignore_query: true)
end
it 'prompts the user to si... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/delete_organization_spec.rb | Ruby | bsd-3-clause | 187 | master | 751 | require 'rails_helper'
describe 'Delete organization' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'when submitting warning', :js do
find_link(I18n.t('admin.buttons.delete_organization')).click
find_link(I18n.t('admin.buttons.confirm_... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_tax_id_spec.rb | Ruby | bsd-3-clause | 187 | master | 377 | require 'rails_helper'
describe 'Update tax id' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with tax id' do
fill_in 'organization_tax_id', with: '12-1234567'
click_button I18n.t('admin.buttons.save_changes')
expect(find_field('o... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_email_spec.rb | Ruby | bsd-3-clause | 187 | master | 617 | require 'rails_helper'
describe 'Update email' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with valid organization email' do
fill_in 'organization_email', with: 'foo@bar.com'
click_button I18n.t('admin.buttons.save_changes')
exp... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/create_contact_spec.rb | Ruby | bsd-3-clause | 187 | master | 2,311 | require 'rails_helper'
describe 'Create a new contact for organization' do
before do
@org = create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
click_link I18n.t('admin.buttons.add_contact')
end
it 'creates a contact for the right organization' do
expect(page).... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/create_organization_spec.rb | Ruby | bsd-3-clause | 187 | master | 5,188 | require 'rails_helper'
describe 'Create a new organization' do
before do
create(:organization)
login_super_admin
visit('/admin/organizations/new')
end
it 'with all required fields' do
fill_in 'organization_name', with: 'new org'
fill_in 'organization_description', with: 'description for new ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_alternate_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 472 | require 'rails_helper'
describe 'Update alternate name' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with alternate name' do
fill_in 'organization_alternate_name', with: 'Juvenile Sexual Responsibility Program'
click_button I18n.t('a... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 665 | require 'rails_helper'
describe 'Update name' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with empty organization name' do
fill_in 'organization_name', with: ''
click_button I18n.t('admin.buttons.save_changes')
expect(page).to h... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_funding_sources_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,278 | require 'rails_helper'
describe 'Update funding_sources' do
before do
@organization = create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with no funding_sources' do
click_button I18n.t('admin.buttons.save_changes')
expect(@organization.reload.funding_s... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/delete_contact_spec.rb | Ruby | bsd-3-clause | 187 | master | 540 | require 'rails_helper'
describe 'Delete contact' do
before do
@org = create(:organization)
@org.contacts.create!(attributes_for(:contact))
login_super_admin
visit '/admin/organizations/parent-agency'
click_link 'Moncef Belyamani'
end
it 'when deleting contact' do
find_link(I18n.t('admin.... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_contact_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 870 | require 'rails_helper'
describe 'Update name' do
before do
org = create(:organization)
org.contacts.create!(attributes_for(:contact))
login_super_admin
visit '/admin/organizations/parent-agency'
click_link 'Moncef Belyamani'
end
it 'with empty name' do
fill_in 'contact_name', with: ''
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_phone_numbers_spec.rb | Ruby | bsd-3-clause | 187 | master | 3,863 | require 'rails_helper'
describe 'Update phones' do
before do
@org = create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'when no phones exist' do
within('.phones') do
expect(page).
to have_no_xpath('.//input[contains(@name, "[extension]")]')
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_description_spec.rb | Ruby | bsd-3-clause | 187 | master | 714 | require 'rails_helper'
describe 'Update description' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with empty organization description' do
fill_in 'organization_description', with: ''
click_button I18n.t('admin.buttons.save_changes')
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/organizations/update_legal_status_spec.rb | Ruby | bsd-3-clause | 187 | master | 401 | require 'rails_helper'
describe 'Update legal status' do
before do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
it 'with legal status' do
fill_in 'organization_legal_status', with: 'non-profit'
click_button I18n.t('admin.buttons.save_changes')
ex... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/programs/delete_program_spec.rb | Ruby | bsd-3-clause | 187 | master | 802 | require 'rails_helper'
describe 'Delete program' do
before do
loc = create(:location)
program = loc.organization.programs.create!(attributes_for(:program))
login_super_admin
visit admin_program_path(program)
end
it 'when submitting warning', :js do
find_link(I18n.t('admin.buttons.delete_prog... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/programs/create_program_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,096 | require 'rails_helper'
describe 'Create a new program' do
before do
create(:location)
login_super_admin
visit('/admin/programs/new')
end
it 'with all required fields', :js do
select2('Parent Agency', 'org-name')
fill_in 'program_name', with: 'New Program'
click_button I18n.t('admin.butto... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/programs/update_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 703 | require 'rails_helper'
describe 'Update name' do
before do
loc = create(:location)
program = loc.organization.programs.create!(attributes_for(:program))
login_super_admin
visit admin_program_path(program)
end
it 'with empty name' do
fill_in 'program_name', with: ''
click_button I18n.t('a... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/programs/update_alternate_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 552 | require 'rails_helper'
describe 'Update alternate name' do
before do
loc = create(:location)
program = loc.organization.programs.create!(attributes_for(:program))
login_super_admin
visit admin_program_path(program)
end
it 'with valid alternate_name' do
fill_in 'program_alternate_name', with:... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/programs/visit_programs_spec.rb | Ruby | bsd-3-clause | 187 | master | 3,086 | require 'rails_helper'
describe 'Programs page' do
context 'when not signed in' do
before do
visit '/admin/programs'
end
it 'redirects to the admin sign in page' do
expect(page).to have_current_path(new_admin_session_path, ignore_query: true)
end
it 'prompts the user to sign in or s... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_phone_numbers_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,857 | require 'rails_helper'
describe 'Update phones' do
before do
@location = create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'when no phones exist' do
within('.phones') do
expect(page).
to have_no_xpath('.//input[contains(@name, "[extension]")]')
en... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_alternate_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 455 | require 'rails_helper'
describe 'Update alternate name' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with alternate name' do
fill_in 'location_alternate_name', with: 'Juvenile Sexual Responsibility Program'
click_button I18n.t('admin.buttons.... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/create_location_spec.rb | Ruby | bsd-3-clause | 187 | master | 7,122 | require 'rails_helper'
describe 'Create a new location' do
before do
create(:organization)
login_super_admin
visit('/admin/locations/new')
end
it 'with all required fields', :js do
fill_in_all_required_fields
click_button I18n.t('admin.buttons.create_location')
expect(page).to have_curr... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_email_spec.rb | Ruby | bsd-3-clause | 187 | master | 600 | require 'rails_helper'
describe 'Update email' do
before do
@location = create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with valid location email' do
fill_in 'location_email', with: 'foo@bar.com'
click_button I18n.t('admin.buttons.save_changes')
expect(f... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_virtual_spec.rb | Ruby | bsd-3-clause | 187 | master | 393 | require 'rails_helper'
describe 'Update virtual attribute' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'setting to true' do
select('Does not have a physical address', from: 'location_virtual')
click_button I18n.t('admin.buttons.save_changes')... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_website_spec.rb | Ruby | bsd-3-clause | 187 | master | 690 | require 'rails_helper'
describe 'Update website' do
before do
@location = create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with invalid website' do
fill_in 'location_website', with: 'www.monfresh.com'
click_button I18n.t('admin.buttons.save_changes')
expe... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/visit_locations_spec.rb | Ruby | bsd-3-clause | 187 | master | 3,476 | require 'rails_helper'
describe 'Locations page' do
context 'when not signed in' do
before do
visit '/admin/locations'
end
it 'redirects to the admin sign in page' do
expect(page).to have_current_path(new_admin_session_path, ignore_query: true)
end
it 'prompts the user to sign in or... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_address_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,147 | require 'rails_helper'
describe 'Add a street address' do
before do
@location = create(:no_address)
login_super_admin
visit '/admin/locations/no-address'
end
it 'adding a new street address with valid values', :js do
add_street_address(address_1: '123', city: 'Vienn', state_province: 'VA',
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_short_description_spec.rb | Ruby | bsd-3-clause | 187 | master | 630 | require 'rails_helper'
describe 'Update short description' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with empty description' do
fill_in 'location_short_desc', with: ''
click_button I18n.t('admin.buttons.save_changes')
expect(find_field... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_accessibility_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,534 | require 'rails_helper'
describe "Update a location's accessibility options" do
before(:all) do
@location = create(:soup_kitchen)
end
before do
@location.reload
login_super_admin
visit '/admin/locations/soup-kitchen'
end
after(:all) do
Organization.find_each(&:destroy)
end
it "when ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/delete_location_spec.rb | Ruby | bsd-3-clause | 187 | master | 716 | require 'rails_helper'
describe 'Delete location' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'when submitting warning', :js do
find_link(I18n.t('admin.buttons.delete_location')).click
find_link(I18n.t('admin.buttons.confirm_delete_location')... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_description_spec.rb | Ruby | bsd-3-clause | 187 | master | 622 | require 'rails_helper'
describe 'Update description' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with empty description' do
fill_in 'location_description', with: ''
click_button I18n.t('admin.buttons.save_changes')
expect(page).to have_c... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_languages_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,096 | require 'rails_helper'
describe 'Update languages' do
before do
@location = create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with no languages' do
click_button I18n.t('admin.buttons.save_changes')
expect(@location.reload.languages).to eq []
end
it 'with ... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_mail_address_spec.rb | Ruby | bsd-3-clause | 187 | master | 4,003 | require 'rails_helper'
describe 'Updating mailing address' do
before do
@location = create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'adding a new mailing address with valid values', :js do
add_mailing_address(
attention: 'moncef',
address_1: '123',
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_admin_emails_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,312 | require 'rails_helper'
describe 'Update admin_emails' do
before do
@location = create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'when no admin_emails exist' do
expect(page).to have_no_xpath("//input[@name='location[admin_emails][]']")
expect(page).not_to have_... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_transportation_spec.rb | Ruby | bsd-3-clause | 187 | master | 685 | require 'rails_helper'
describe 'Update transportation options' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with empty transportation options' do
fill_in 'location_transportation', with: ''
click_button I18n.t('admin.buttons.save_changes')
... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/ability_to_add_admin_email_spec.rb | Ruby | bsd-3-clause | 187 | master | 1,207 | require 'rails_helper'
describe 'ability to add an admin to a location' do
before do
@location = create(:location)
end
context 'when neither super admin nor location admin' do
it "doesn't allow adding an admin" do
login_admin
visit '/admin/locations/vrs-services'
expect(page).not_to ha... |
github | codeforamerica/ohana-api | https://github.com/codeforamerica/ohana-api | spec/features/admin/locations/update_name_spec.rb | Ruby | bsd-3-clause | 187 | master | 683 | require 'rails_helper'
describe 'Update name' do
before do
create(:location)
login_super_admin
visit '/admin/locations/vrs-services'
end
it 'with empty location name' do
fill_in 'location_name', with: ''
click_button I18n.t('admin.buttons.save_changes')
expect(page).to have_content "Name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.