-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually get dummy test app running properly and passing feature tests
* Configure dummy test all with the test controller/views for demo under test * properly set up sprockets for bootstrap 4 to include JS in dummy app * properly get all dummy app dependencies set up -- this is the weirdest most confusing part * dependencies are actually listed in .gemspec as development dependencies * but may also need to be require'd in application.rb, which would normally happen automatically if they were in a real Gemfile * We give up on being able to test both bootstrap 3 and 4 -- that's not really tenable with the dummy app approach, since they use different gems entirely, and different local CSS files. We only test bootstrap 4 now. * Actually enable the formerly disabled feature tests!
- Loading branch information
Showing
13 changed files
with
95 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
//= link_tree ../images | ||
//= link_directory ../javascripts .js | ||
//= link_directory ../stylesheets .css | ||
//= link application.css | ||
//= link application.js |
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
11 changes: 11 additions & 0 deletions
11
spec/dummy_test_app/app/controllers/file_handler_controller.rb
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,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class FileHandlerController < ApplicationController | ||
def index; end | ||
|
||
def main; end | ||
|
||
def update | ||
render json: params[:selected_files].to_json | ||
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,10 @@ | ||
<div class="panel panel-default"> | ||
<div class="panel-body"> | ||
<a href="main" class="btn btn-large btn-primary" role="button">Enter Test App (Turbolinks)</a> | ||
|
||
<%# this doesn't REALLY test no Turbolinks, as there will still be a `window.Turbolinks` object, | ||
and a `turbolinks:load` event. It just tests as if the page we are navigating to were the FIRST | ||
page loaded under turbolinks %> | ||
<a href="main" class="btn btn-large btn-primary" role="button" data-turbolinks="false" data-no-turbolink>Enter Test App (No Turbolinks)</a> | ||
</div> | ||
</div> |
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,25 @@ | ||
<div class="jumbotron"> | ||
<h1>Welcome!</h1> | ||
|
||
<p>Please click the button below to start pickin' files!</p> | ||
|
||
<%= form_tag('/file', id: 'main_form', method: 'post') do %> | ||
<%= button_tag("Browse", type: 'button', class: 'btn btn-large btn-success', id: "browse-btn", | ||
'data-toggle' => 'browse-everything', 'data-route' => browse_everything_engine.root_path, | ||
'data-target' => '#main_form') %> | ||
<%= button_tag("Submit", type: 'submit', class: 'btn btn-large btn-primary', id: "submit-btn") %> | ||
<% end %> | ||
|
||
<p id="status">0 items selected</p> | ||
|
||
<script> | ||
$(document).on('turbolinks:load', function() { | ||
// Have to make sure onReady is ALSO passed, in case it's first load. | ||
$(function() { | ||
$('#browse-btn').browseEverything() | ||
.done(function(data) { $('#status').html(data.length.toString() + " items selected") }) | ||
.cancel(function() { window.alert('Canceled!') }); | ||
}); | ||
}); | ||
</script> | ||
</div> |
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,4 +1,9 @@ | ||
Rails.application.routes.draw do | ||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | ||
mount BrowseEverything::Engine => '/browse' | ||
|
||
# Custom actions we use for feature testing | ||
root :to => "file_handler#index" | ||
get '/main', :to => "file_handler#main" | ||
post '/file', :to => "file_handler#update" | ||
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
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