Fix Jasmine tests - first pass
193 specs | 5 failing The 5 failing specs appear (according to Firebug) to be due to missing fixtures and/or missing routes in the Jasmine environment. Fixing these last 5 failures is a task probably best left to a more experienced Javascript/Jasmine developer. This commit also moves validation.js and clear-form.js into app/assets/javascripts and precompiles validation.js
This commit is contained in:
parent
e1607baff4
commit
95d5c9ca68
21 changed files with 68 additions and 95 deletions
3
Gemfile
3
Gemfile
|
|
@ -123,7 +123,8 @@ gem 'em-synchrony', '1.0.0', :platforms => :ruby_19
|
||||||
|
|
||||||
# jazzy jasmine
|
# jazzy jasmine
|
||||||
|
|
||||||
gem 'jasmine', '~> 1.1.2'
|
# Use the latest Jasmine from github for asset pipeline compatibility
|
||||||
|
gem 'jasmine', :git => 'git://github.com/pivotal/jasmine-gem.git'
|
||||||
|
|
||||||
### GROUPS ####
|
### GROUPS ####
|
||||||
|
|
||||||
|
|
|
||||||
27
Gemfile.lock
27
Gemfile.lock
|
|
@ -34,6 +34,27 @@ GIT
|
||||||
rack-fiber_pool
|
rack-fiber_pool
|
||||||
sinatra
|
sinatra
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
GIT
|
||||||
|
remote: git://github.com/pivotal/jasmine-gem.git
|
||||||
|
revision: 34c1529c3f7b78ebd81ac16006f141fc6b7cf013
|
||||||
|
specs:
|
||||||
|
jasmine (1.2.0.rc2)
|
||||||
|
jasmine-core (>= 1.2.0.rc1)
|
||||||
|
rack (>= 1.1)
|
||||||
|
rspec (>= 1.3.1)
|
||||||
|
selenium-webdriver (>= 0.1.3)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: git://github.com/socialcast/resque-ensure-connected.git
|
||||||
|
revision: 8ac0f9e4658495097fb333a93db81d54ba9a5311
|
||||||
|
specs:
|
||||||
|
resque-ensure-connected (0.2.0)
|
||||||
|
activerecord (>= 2.3.5)
|
||||||
|
resque (>= 1.10.0)
|
||||||
|
|
||||||
|
>>>>>>> Fix Jasmine tests - first pass
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
|
@ -209,6 +230,7 @@ GEM
|
||||||
actionpack (~> 3.0)
|
actionpack (~> 3.0)
|
||||||
i18n-inflector (~> 2.6)
|
i18n-inflector (~> 2.6)
|
||||||
railties (~> 3.0)
|
railties (~> 3.0)
|
||||||
|
<<<<<<< HEAD
|
||||||
jasmine (1.1.2)
|
jasmine (1.1.2)
|
||||||
jasmine-core (>= 1.1.0)
|
jasmine-core (>= 1.1.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
|
|
@ -218,6 +240,9 @@ GEM
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
json (1.6.6)
|
json (1.6.6)
|
||||||
=======
|
=======
|
||||||
|
=======
|
||||||
|
jasmine-core (1.2.0.rc1)
|
||||||
|
>>>>>>> Fix Jasmine tests - first pass
|
||||||
jquery-rails (1.0.19)
|
jquery-rails (1.0.19)
|
||||||
railties (~> 3.0)
|
railties (~> 3.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
|
|
@ -489,7 +514,7 @@ DEPENDENCIES
|
||||||
heroku_san
|
heroku_san
|
||||||
http_accept_language (~> 1.0.2)
|
http_accept_language (~> 1.0.2)
|
||||||
i18n-inflector-rails (~> 1.0)
|
i18n-inflector-rails (~> 1.0)
|
||||||
jasmine (~> 1.1.2)
|
jasmine!
|
||||||
jquery-rails
|
jquery-rails
|
||||||
json
|
json
|
||||||
jwt
|
jwt
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ var app = {
|
||||||
|
|
||||||
baseImageUrl: function(baseUrl){
|
baseImageUrl: function(baseUrl){
|
||||||
if(baseUrl) { return this._baseImageUrl = baseUrl }
|
if(baseUrl) { return this._baseImageUrl = baseUrl }
|
||||||
return this._baseImageUrl || ""
|
return this._baseImageUrl || "assets/"
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ app.views.Photos = Backbone.View.extend({
|
||||||
|
|
||||||
appendLoader: function(){
|
appendLoader: function(){
|
||||||
$("#paginate").html($("<img>", {
|
$("#paginate").html($("<img>", {
|
||||||
src : "/images/static-loader.png",
|
src : "/assets/static-loader.png",
|
||||||
"class" : "loader"
|
"class" : "loader"
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ app.views.Stream = Backbone.View.extend({
|
||||||
|
|
||||||
appendLoader: function(){
|
appendLoader: function(){
|
||||||
$("#paginate").html($("<img>", {
|
$("#paginate").html($("<img>", {
|
||||||
src : "/images/static-loader.png",
|
src : "/assets/static-loader.png",
|
||||||
"class" : "loader"
|
"class" : "loader"
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ $(document).ready(function(){
|
||||||
debug: false,
|
debug: false,
|
||||||
donetext: "no more.",
|
donetext: "no more.",
|
||||||
loadingText: "",
|
loadingText: "",
|
||||||
loadingImg: '/images/ajax-loader.gif'
|
loadingImg: '/assets/ajax-loader.gif'
|
||||||
}, function(){
|
}, function(){
|
||||||
$('.conversation', '.stream').bind('mousedown', function(){
|
$('.conversation', '.stream').bind('mousedown', function(){
|
||||||
bindIt($(this));
|
bindIt($(this));
|
||||||
|
|
|
||||||
12
app/assets/javascripts/jasmine-load-all.js
Normal file
12
app/assets/javascripts/jasmine-load-all.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
//= require jquery
|
||||||
|
//= require handlebars-1.0.0.beta.6
|
||||||
|
//= require templates
|
||||||
|
//= require main
|
||||||
|
//= require home
|
||||||
|
//= require finder
|
||||||
|
//= require inbox
|
||||||
|
//= require login
|
||||||
|
//= require mobile
|
||||||
|
//= require profile
|
||||||
|
//= require people
|
||||||
|
//= require photos
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
* licensed under the Affero General Public License version 3 or later. See
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
* the COPYRIGHT file.
|
* the COPYRIGHT file.
|
||||||
*/
|
*/
|
||||||
|
//= require jquery_ujs
|
||||||
|
//= require underscore
|
||||||
|
//= require backbone
|
||||||
//= require rails.validations
|
//= require rails.validations
|
||||||
//= require jquery.hotkeys
|
//= require jquery.hotkeys
|
||||||
//= require jquery.autoresize
|
//= require jquery.autoresize
|
||||||
|
|
@ -10,7 +13,6 @@
|
||||||
//= require jquery.placeholder
|
//= require jquery.placeholder
|
||||||
//= require timeago
|
//= require timeago
|
||||||
//= require facebox
|
//= require facebox
|
||||||
//= require underscore
|
|
||||||
//= require jquery.events.input
|
//= require jquery.events.input
|
||||||
//= require jquery.elastic
|
//= require jquery.elastic
|
||||||
//= require jquery.mentionsInput
|
//= require jquery.mentionsInput
|
||||||
|
|
@ -19,9 +21,10 @@
|
||||||
//= require jquery.autocomplete-custom
|
//= require jquery.autocomplete-custom
|
||||||
//= require keycodes
|
//= require keycodes
|
||||||
//= require fileuploader-custom
|
//= require fileuploader-custom
|
||||||
//= require backbone
|
|
||||||
//= require handlebars-1.0.0.beta.6
|
//= require handlebars-1.0.0.beta.6
|
||||||
//= require markdown
|
//= require markdown
|
||||||
|
//= require clear-form
|
||||||
|
//= require validation
|
||||||
//= require app/app
|
//= require app/app
|
||||||
//= require diaspora
|
//= require diaspora
|
||||||
//= require_tree ./helpers
|
//= require_tree ./helpers
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
* licensed under the Affero General Public License version 3 or later. See
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
* the COPYRIGHT file.
|
* the COPYRIGHT file.
|
||||||
*/
|
*/
|
||||||
|
//= require mailchimp/jquery.form
|
||||||
var View = {
|
var View = {
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
/* Buttons */
|
/* Buttons */
|
||||||
|
|
@ -63,8 +64,8 @@ var View = {
|
||||||
$(document.body).click(this.dropdowns.removeFocus);
|
$(document.body).click(this.dropdowns.removeFocus);
|
||||||
|
|
||||||
/* facebox */
|
/* facebox */
|
||||||
$.facebox.settings.closeImage = '/images/facebox/closelabel.png';
|
$.facebox.settings.closeImage = '/assets/facebox/closelabel.png';
|
||||||
$.facebox.settings.loadingImage = '/images/facebox/loading.gif';
|
$.facebox.settings.loadingImage = '/assets/facebox/loading.gif';
|
||||||
$.facebox.settings.opacity = 0.75;
|
$.facebox.settings.opacity = 0.75;
|
||||||
|
|
||||||
$('a[rel*=facebox]').facebox();
|
$('a[rel*=facebox]').facebox();
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
debug: false,
|
debug: false,
|
||||||
donetext: Diaspora.I18n.t("infinite_scroll.no_more"),
|
donetext: Diaspora.I18n.t("infinite_scroll.no_more"),
|
||||||
loadingText: "",
|
loadingText: "",
|
||||||
loadingImg: "/images/ajax-loader.gif",
|
loadingImg: "/assets/ajax-loader.gif",
|
||||||
navSelector: "#pagination",
|
navSelector: "#pagination",
|
||||||
nextSelector: ".paginate",
|
nextSelector: ".paginate",
|
||||||
itemSelector: ".stream_element",
|
itemSelector: ".stream_element",
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ ul.as-selections {
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.as-selections.loading {
|
ul.as-selections.loading {
|
||||||
background: url("/images/ajax-loader.gif") right center no-repeat;
|
background: url("/assets/ajax-loader.gif") right center no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.as-selections li {
|
ul.as-selections li {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +0,0 @@
|
||||||
// Workaround to keep "app/templates" out of the template names
|
|
||||||
// All templates will remain in the JST namespace just as they were
|
|
||||||
// when we were using Jammit
|
|
||||||
//= require_tree .
|
|
||||||
|
|
@ -73,7 +73,8 @@ module Diaspora
|
||||||
# Javascripts
|
# Javascripts
|
||||||
config.assets.precompile += [ "finder.js", "home.js", "ie.js", "inbox.js",
|
config.assets.precompile += [ "finder.js", "home.js", "ie.js", "inbox.js",
|
||||||
"jquery.js", "jquery_ujs.js", "login.js", "mailchimp.js", "main.js",
|
"jquery.js", "jquery_ujs.js", "login.js", "mailchimp.js", "main.js",
|
||||||
"mobile.js", "profile.js", "people.js", "photos.js", "templates.js" ]
|
"mobile.js", "profile.js", "people.js", "photos.js", "templates.js",
|
||||||
|
"validation.js" ]
|
||||||
|
|
||||||
# Stylesheets
|
# Stylesheets
|
||||||
config.assets.precompile += [ "blueprint.css", "bootstrap.css", "default.css",
|
config.assets.precompile += [ "blueprint.css", "bootstrap.css", "default.css",
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@ namespace :deploy do
|
||||||
end
|
end
|
||||||
|
|
||||||
task :bundle_static_assets do
|
task :bundle_static_assets do
|
||||||
run "cd #{current_path} && bundle exec sass --update public/stylesheets/sass:public/stylesheets"
|
run "cd #{current_path} && bundle exec rake assets:precompile"
|
||||||
run "cd #{current_path} && bundle exec jammit"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
task :restart do
|
task :restart do
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace :ci do
|
||||||
system("bundle exec #{cmd}")
|
system("bundle exec #{cmd}")
|
||||||
raise "#{cmd} failed!" unless $?.exitstatus == 0
|
raise "#{cmd} failed!" unless $?.exitstatus == 0
|
||||||
end
|
end
|
||||||
['jammit', "rake jasmine:ci", "rake cucumber"].each do |cmd|
|
["rake jasmine:ci", "rake cucumber"].each do |cmd|
|
||||||
puts "Running bundle exec #{cmd}..."
|
puts "Running bundle exec #{cmd}..."
|
||||||
system("export DISPLAY=:99.0 && GROUP=oauth bundle exec #{cmd}")
|
system("export DISPLAY=:99.0 && GROUP=oauth bundle exec #{cmd}")
|
||||||
raise "#{cmd} failed!" unless $?.exitstatus == 0
|
raise "#{cmd} failed!" unless $?.exitstatus == 0
|
||||||
|
|
|
||||||
|
|
@ -11,63 +11,8 @@
|
||||||
# - dist/**/*.js
|
# - dist/**/*.js
|
||||||
#
|
#
|
||||||
src_files:
|
src_files:
|
||||||
# load up our outputted templates, bound to window.JST
|
# Precompile all scripts together for the test environment
|
||||||
- public/javascripts/vendor/handlebars-1.0.0.beta.6.js
|
- assets/jasmine-load-all.js
|
||||||
- public/assets/templates.js
|
|
||||||
|
|
||||||
- public/javascripts/vendor/underscore.js
|
|
||||||
- public/javascripts/vendor/jquery-1.7.1.min.js
|
|
||||||
- public/javascripts/vendor/jquery-ui-1.8.9.custom.min.js
|
|
||||||
- public/javascripts/vendor/bootstrap/bootstrap-twipsy.js
|
|
||||||
- public/javascripts/vendor/bootstrap/bootstrap-popover.js
|
|
||||||
- public/javascripts/vendor/jquery.tipsy.js
|
|
||||||
- public/javascripts/vendor/jquery.infinitescroll.min.js
|
|
||||||
- public/javascripts/vendor/jquery.autoresize.js
|
|
||||||
- public/javascripts/vendor/jquery.expander.js
|
|
||||||
- public/javascripts/vendor/jquery.charcount.js
|
|
||||||
- public/javascripts/vendor/jquery.mentionsInput.js
|
|
||||||
- public/javascripts/vendor/jquery.idle-timer.js
|
|
||||||
- public/javascripts/vendor/timeago.js
|
|
||||||
- public/javascripts/vendor/facebox.js
|
|
||||||
- public/javascripts/vendor/markdown/*
|
|
||||||
- public/javascripts/vendor/punycode.js
|
|
||||||
- public/javascripts/vendor/jquery.placeholder.js
|
|
||||||
- public/javascripts/vendor/backbone.js
|
|
||||||
- public/javascripts/fileuploader-custom.js
|
|
||||||
- public/javascripts/jquery.autocomplete-custom.js
|
|
||||||
- public/javascripts/diaspora.js
|
|
||||||
- public/javascripts/keycodes.js
|
|
||||||
|
|
||||||
- public/javascripts/pages/*
|
|
||||||
- public/javascripts/helpers/*
|
|
||||||
- public/javascripts/widgets/*
|
|
||||||
|
|
||||||
- public/javascripts/app/app.js
|
|
||||||
- public/javascripts/app/helpers/*
|
|
||||||
- public/javascripts/app/router.js
|
|
||||||
- public/javascripts/app/views.js
|
|
||||||
- public/javascripts/app/forms.js
|
|
||||||
- public/javascripts/app/models/post.js
|
|
||||||
- public/javascripts/app/models/*
|
|
||||||
- public/javascripts/app/collections/*
|
|
||||||
- public/javascripts/app/views/stream_object_view.js
|
|
||||||
- public/javascripts/app/views/content_view.js
|
|
||||||
- public/javascripts/app/views/*.js
|
|
||||||
- public/javascripts/app/views/**/*.js
|
|
||||||
- public/javascripts/app/pages/**/*.js
|
|
||||||
- public/javascripts/app/forms/**/*.js
|
|
||||||
|
|
||||||
- public/javascripts/mobile.js
|
|
||||||
- public/javascripts/contact-list.js
|
|
||||||
- public/javascripts/view.js
|
|
||||||
- public/javascripts/mentions.js
|
|
||||||
- public/javascripts/publisher.js
|
|
||||||
- public/javascripts/stream.js
|
|
||||||
- public/javascripts/validation.js
|
|
||||||
- public/javascripts/rails.js
|
|
||||||
- public/javascripts/aspects-dropdown.js
|
|
||||||
- public/javascripts/content-updater.js
|
|
||||||
- public/javascripts/tag-followings.js
|
|
||||||
|
|
||||||
# stylesheets
|
# stylesheets
|
||||||
#
|
#
|
||||||
|
|
@ -81,7 +26,13 @@ src_files:
|
||||||
# - stylesheets/*.css
|
# - stylesheets/*.css
|
||||||
#
|
#
|
||||||
stylesheets:
|
stylesheets:
|
||||||
- stylesheets/**/*.css
|
- assets/blueprint.css
|
||||||
|
- assets/bootstrap.css
|
||||||
|
- assets/default.css
|
||||||
|
- assets/login.css
|
||||||
|
#- assets/mobile.css
|
||||||
|
- assets/new_templates.css
|
||||||
|
#- assets/rtl.css
|
||||||
|
|
||||||
# helpers
|
# helpers
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
require 'jammit'
|
|
||||||
module Jasmine
|
|
||||||
class Config
|
|
||||||
Jammit.reload!
|
|
||||||
Jammit.package!
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -6,15 +6,6 @@ require 'rubygems'
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'jasmine'
|
require 'jasmine'
|
||||||
require 'rspec'
|
require 'rspec'
|
||||||
jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config.rb'))
|
|
||||||
|
|
||||||
begin
|
|
||||||
require jasmine_config_overrides if File.exists?(jasmine_config_overrides)
|
|
||||||
rescue Exception => e
|
|
||||||
#we do this because when we are locally developing JS, our local jammit
|
|
||||||
# helps us re-run jasmine tests by jammiting every time.
|
|
||||||
#on ci, this causes problems, but we only need to jammit once
|
|
||||||
end
|
|
||||||
|
|
||||||
jasmine_config = Jasmine::Config.new
|
jasmine_config = Jasmine::Config.new
|
||||||
spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
|
spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue