Permalink
Browse files

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
  • Loading branch information...
1 parent e1607ba commit 95d5c9ca681e9990a2caf10448b922339b9d694a @stevenh512 stevenh512 committed with maxwell Mar 22, 2012
View
@@ -123,7 +123,8 @@ gem 'em-synchrony', '1.0.0', :platforms => :ruby_19
# 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 ####
View
@@ -34,6 +34,27 @@ GIT
rack-fiber_pool
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
remote: http://rubygems.org/
specs:
@@ -209,6 +230,7 @@ GEM
actionpack (~> 3.0)
i18n-inflector (~> 2.6)
railties (~> 3.0)
+<<<<<<< HEAD
jasmine (1.1.2)
jasmine-core (>= 1.1.0)
rack (>= 1.1)
@@ -218,6 +240,9 @@ GEM
<<<<<<< HEAD
json (1.6.6)
=======
+=======
+ jasmine-core (1.2.0.rc1)
+>>>>>>> Fix Jasmine tests - first pass
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
@@ -489,7 +514,7 @@ DEPENDENCIES
heroku_san
http_accept_language (~> 1.0.2)
i18n-inflector-rails (~> 1.0)
- jasmine (~> 1.1.2)
+ jasmine!
jquery-rails
json
jwt
@@ -21,7 +21,7 @@ var app = {
baseImageUrl: function(baseUrl){
if(baseUrl) { return this._baseImageUrl = baseUrl }
- return this._baseImageUrl || ""
+ return this._baseImageUrl || "assets/"
},
initialize: function() {
@@ -39,7 +39,7 @@ app.views.Photos = Backbone.View.extend({
appendLoader: function(){
$("#paginate").html($("<img>", {
- src : "/images/static-loader.png",
+ src : "/assets/static-loader.png",
"class" : "loader"
}));
},
@@ -85,7 +85,7 @@ app.views.Stream = Backbone.View.extend({
appendLoader: function(){
$("#paginate").html($("<img>", {
- src : "/images/static-loader.png",
+ src : "/assets/static-loader.png",
"class" : "loader"
}));
},
@@ -56,7 +56,7 @@ $(document).ready(function(){
debug: false,
donetext: "no more.",
loadingText: "",
- loadingImg: '/images/ajax-loader.gif'
+ loadingImg: '/assets/ajax-loader.gif'
}, function(){
$('.conversation', '.stream').bind('mousedown', function(){
bindIt($(this));
@@ -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
* the COPYRIGHT file.
*/
+//= require jquery_ujs
+//= require underscore
+//= require backbone
//= require rails.validations
//= require jquery.hotkeys
//= require jquery.autoresize
@@ -10,7 +13,6 @@
//= require jquery.placeholder
//= require timeago
//= require facebox
-//= require underscore
//= require jquery.events.input
//= require jquery.elastic
//= require jquery.mentionsInput
@@ -19,9 +21,10 @@
//= require jquery.autocomplete-custom
//= require keycodes
//= require fileuploader-custom
-//= require backbone
//= require handlebars-1.0.0.beta.6
//= require markdown
+//= require clear-form
+//= require validation
//= require app/app
//= require diaspora
//= require_tree ./helpers
@@ -2,6 +2,7 @@
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
+//= require mailchimp/jquery.form
var View = {
initialize: function() {
/* Buttons */
@@ -63,8 +64,8 @@ var View = {
$(document.body).click(this.dropdowns.removeFocus);
/* facebox */
- $.facebox.settings.closeImage = '/images/facebox/closelabel.png';
- $.facebox.settings.loadingImage = '/images/facebox/loading.gif';
+ $.facebox.settings.closeImage = '/assets/facebox/closelabel.png';
+ $.facebox.settings.loadingImage = '/assets/facebox/loading.gif';
$.facebox.settings.opacity = 0.75;
$('a[rel*=facebox]').facebox();
@@ -11,7 +11,7 @@
debug: false,
donetext: Diaspora.I18n.t("infinite_scroll.no_more"),
loadingText: "",
- loadingImg: "/images/ajax-loader.gif",
+ loadingImg: "/assets/ajax-loader.gif",
navSelector: "#pagination",
nextSelector: ".paginate",
itemSelector: ".stream_element",
@@ -16,7 +16,7 @@ ul.as-selections {
}
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 {
Oops, something went wrong.
@@ -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 .
View
@@ -73,7 +73,8 @@ class Application < Rails::Application
# Javascripts
config.assets.precompile += [ "finder.js", "home.js", "ie.js", "inbox.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
config.assets.precompile += [ "blueprint.css", "bootstrap.css", "default.css",
View
@@ -41,8 +41,7 @@ def current_git_branch
end
task :bundle_static_assets do
- run "cd #{current_path} && bundle exec sass --update public/stylesheets/sass:public/stylesheets"
- run "cd #{current_path} && bundle exec jammit"
+ run "cd #{current_path} && bundle exec rake assets:precompile"
end
task :restart do
View
@@ -12,7 +12,7 @@ namespace :ci do
system("bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
- ['jammit', "rake jasmine:ci", "rake cucumber"].each do |cmd|
+ ["rake jasmine:ci", "rake cucumber"].each do |cmd|
puts "Running bundle exec #{cmd}..."
system("export DISPLAY=:99.0 && GROUP=oauth bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
@@ -11,63 +11,8 @@
# - dist/**/*.js
#
src_files:
- # load up our outputted templates, bound to window.JST
- - public/javascripts/vendor/handlebars-1.0.0.beta.6.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
+ # Precompile all scripts together for the test environment
+ - assets/jasmine-load-all.js
# stylesheets
#
@@ -81,7 +26,13 @@ src_files:
# - stylesheets/*.css
#
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
#
@@ -1,7 +0,0 @@
-require 'jammit'
-module Jasmine
- class Config
- Jammit.reload!
- Jammit.package!
- end
-end
@@ -6,15 +6,6 @@
require 'json'
require 'jasmine'
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
spec_builder = Jasmine::SpecBuilder.new(jasmine_config)

0 comments on commit 95d5c9c

Please sign in to comment.