This repository has been archived by the owner on Feb 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ucsblibrary/feature_test
Feature test for creating an exhibit via the UI
- Loading branch information
Showing
9 changed files
with
198 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,3 @@ | |
|
||
# site-specific settings | ||
/config/import.yml | ||
/config/secrets.yml |
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,11 +1,21 @@ | ||
dist: trusty | ||
language: ruby | ||
cache: bundler | ||
sudo: required | ||
addons: | ||
chrome: stable | ||
rvm: | ||
- 2.5.1 | ||
before_script: | ||
- bin/rails db:test:prepare | ||
before_install: | ||
- openssl aes-256-cbc -K $encrypted_4d6950ff1422_key -iv $encrypted_4d6950ff1422_iv | ||
-in geniza-cd-key.enc -out geniza-cd-key -d | ||
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & | ||
after_success: | ||
- | | ||
if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then | ||
bundle exec cap cd deploy | ||
fi | ||
script: | ||
- bundle exec rake ci |
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,44 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Your secret key is used for verifying the integrity of signed cookies. | ||
# If you change this key, all old signed cookies will become invalid! | ||
|
||
# Make sure the secret is at least 30 characters and all random, | ||
# no regular words or you'll be exposed to dictionary attacks. | ||
# You can use `rails secret` to generate a secure secret key. | ||
|
||
# Make sure the secrets in this file are kept private | ||
# if you're sharing your code publicly. | ||
|
||
# Shared secrets are available across all environments. | ||
|
||
# shared: | ||
# api_key: a1B2c3D4e5F6 | ||
|
||
# Environmental secrets are only available for that specific environment. | ||
|
||
# Do not keep production secrets in the unencrypted secrets file. | ||
# Instead, either read values from the environment. | ||
# Or, use `bin/rails secrets:setup` to configure encrypted secrets | ||
# and move the `production:` environment over there. | ||
default: &default | ||
ldap_host: | ||
ldap_user: | ||
ldap_pass: | ||
ldap_group_base: | ||
ldap_filter: samaccountname | ||
|
||
development: | ||
hostname: localhost | ||
secret_key_base: 6e975aca3fb9aa34971bc073ab0f1b4587e4f3a008e99f91d7ec171e3a0ac57aeee35c725c6787543f62972159ad1825497fa51e210e8708920c7da398b3ac17 | ||
<<: *default | ||
|
||
test: | ||
hostname: localhost | ||
secret_key_base: c98e58e67628a81f204177664023174f6bf514e194d6c9b188d555edc9148011e55145a50690fd63b2209a8ad97991156b509c51e00327ba7fcc6c1b755732ba | ||
|
||
production: | ||
hostname: localhost | ||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> | ||
smtp_host: | ||
<<: *default |
Empty file.
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,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.feature 'Import and Display a Work', :clean, js: true do | ||
include Warden::Test::Helpers | ||
|
||
let(:csv_file_path) { File.join(fixture_path, csv_file_name) } | ||
let(:csv_file_name) { 'url_single_item_exhibit.csv' } | ||
let(:site_admin) { FactoryBot.create(:site_admin) } | ||
|
||
before do | ||
allow(Spotlight::DefaultThumbnailJob).to receive(:perform_later) | ||
login_as site_admin | ||
end | ||
|
||
context 'Create an exhibit' do | ||
it 'creates and populates an exhibit via the UI' do | ||
expect(Spotlight::Exhibit.count).to eq 0 | ||
visit '/' | ||
click_link '[email protected]' | ||
click_link 'Create new exhibit' | ||
fill_in('Title', with: 'Test Exhibit') | ||
fill_in('Tag list', with: 'testing') | ||
click_button 'Save' | ||
expect(page).to have_content 'The exhibit was created.' | ||
expect(Spotlight::Exhibit.count).to eq 1 | ||
exhibit = Spotlight::Exhibit.first | ||
expect(exhibit.title).to eq 'Test Exhibit' | ||
visit('/spotlight/test-exhibit/resources/new') | ||
click_link 'Upload multiple items' | ||
expect(page).to have_content 'CSV File' | ||
page.attach_file('resources_csv_upload[url]', csv_file_path) | ||
click_button 'Add item' | ||
visit '/spotlight/test-exhibit/catalog?utf8=%E2%9C%93&exhibit_id=test-exhibit&search_field=all_fields&q=' | ||
expect(page).to have_content 'A Cute Dog' | ||
end | ||
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
url,full_title_tesim,spotlight_upload_description_tesim,spotlight_upload_attribution_tesim,spotlight_upload_date_tesim | ||
https://images.pexels.com/photos/551628/pexels-photo-551628.jpeg,"A Cute Dog","A freely available image of a cute dog","Kat Jayne" |
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