Permalink
Browse files

WE HAVE A FAILING TEST

  • Loading branch information...
0 parents commit f7508c0bc05ebe5d22bc792e719180cbe2c9e740 @drapergeek committed Dec 16, 2012
Showing with 920 additions and 0 deletions.
  1. +25 −0 .gitignore
  2. +3 −0 .rspec
  3. +27 −0 Gemfile
  4. +170 −0 Gemfile.lock
  5. +12 −0 Guardfile
  6. +1 −0 Procfile
  7. +9 −0 README.md
  8. +18 −0 Rakefile
  9. 0 app/assets/images/.gitkeep
  10. +16 −0 app/assets/javascripts/application.js
  11. +59 −0 app/assets/javascripts/prefilled_input.js
  12. 0 app/assets/stylesheets/_screen.scss
  13. +17 −0 app/assets/stylesheets/application.css.scss
  14. +3 −0 app/controllers/application_controller.rb
  15. +2 −0 app/helpers/application_helper.rb
  16. 0 app/mailers/.gitkeep
  17. 0 app/models/.gitkeep
  18. +7 −0 app/validators/email_validator.rb
  19. +5 −0 app/views/application/_flashes.html.erb
  20. +9 −0 app/views/application/_javascript.html.erb
  21. +22 −0 app/views/layouts/application.html.erb
  22. 0 app/views/pages/.gitkeep
  23. +4 −0 config.ru
  24. +76 −0 config/application.rb
  25. +6 −0 config/boot.rb
  26. +5 −0 config/environment.rb
  27. +39 −0 config/environments/development.rb
  28. +69 −0 config/environments/production.rb
  29. +70 −0 config/environments/staging.rb
  30. +39 −0 config/environments/test.rb
  31. +7 −0 config/initializers/backtrace_silencers.rb
  32. +28 −0 config/initializers/errors.rb
  33. +15 −0 config/initializers/inflections.rb
  34. +5 −0 config/initializers/mime_types.rb
  35. +7 −0 config/initializers/secret_token.rb
  36. +8 −0 config/initializers/session_store.rb
  37. +14 −0 config/initializers/wrap_parameters.rb
  38. +11 −0 config/locales/en.yml
  39. +2 −0 config/routes.rb
  40. +2 −0 doc/README_FOR_APP
  41. 0 lib/assets/.gitkeep
  42. 0 lib/tasks/.gitkeep
  43. 0 log/.gitkeep
  44. +16 −0 public/404.html
  45. +16 −0 public/422.html
  46. +15 −0 public/500.html
  47. 0 public/favicon.ico
  48. +5 −0 public/robots.txt
  49. +6 −0 script/rails
  50. 0 spec/controllers/.gitkeep
  51. +10 −0 spec/features/create_short_url_spec.rb
  52. 0 spec/helpers/.gitkeep
  53. 0 spec/lib/.gitkeep
  54. 0 spec/models/.gitkeep
  55. +40 −0 spec/spec_helper.rb
  56. 0 spec/support/.gitkeep
  57. 0 spec/support/matchers/.gitkeep
  58. 0 spec/support/mixins/.gitkeep
  59. 0 spec/support/shared_examples/.gitkeep
  60. 0 spec/views/.gitkeep
  61. 0 vendor/assets/javascripts/.gitkeep
  62. 0 vendor/assets/stylesheets/.gitkeep
  63. 0 vendor/plugins/.gitkeep
@@ -0,0 +1,25 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+!.keep
+*.DS_Store
+*.swp
+.env
+bin/stubs
+coverage/*
+public/system
+rerun.txt
+tags
+vendor/bundler_gems
3 .rspec
@@ -0,0 +1,3 @@
+--colour
+--drb
+--profile
27 Gemfile
@@ -0,0 +1,27 @@
+source 'https://rubygems.org'
+
+ruby '1.9.3'
+
+gem 'rails', '3.2.8'
+
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+gem 'thin'
+gem 'flutie'
+gem 'bourbon'
+
+group :development, :test do
+ gem 'foreman'
+ gem 'rspec-rails'
+end
+
+group :test do
+ gem 'capybara'
+ gem 'capybara-webkit'
+ gem 'launchy'
+end
@@ -0,0 +1,170 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.8)
+ actionpack (= 3.2.8)
+ mail (~> 2.4.4)
+ actionpack (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.3)
+ activemodel (3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ activerecord (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ activesupport (3.2.8)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ addressable (2.3.2)
+ arel (3.0.2)
+ bourbon (3.0.1)
+ sass (>= 3.2.0)
+ thor
+ builder (3.0.4)
+ capybara (1.1.4)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ capybara-webkit (0.13.0)
+ capybara (>= 1.0.0, < 1.2)
+ json
+ childprocess (0.3.6)
+ ffi (~> 1.0, >= 1.0.6)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.4.0)
+ daemons (1.1.9)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ eventmachine (1.0.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ ffi (1.2.0)
+ flutie (1.3.3)
+ foreman (0.60.2)
+ thor (>= 0.13.6)
+ hike (1.2.1)
+ i18n (0.6.1)
+ journey (1.0.4)
+ jquery-rails (2.1.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ json (1.7.5)
+ launchy (2.1.2)
+ addressable (~> 2.3)
+ libwebsocket (0.1.7.1)
+ addressable
+ websocket
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.5.0)
+ nokogiri (1.5.5)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (3.2.8)
+ actionmailer (= 3.2.8)
+ actionpack (= 3.2.8)
+ activerecord (= 3.2.8)
+ activeresource (= 3.2.8)
+ activesupport (= 3.2.8)
+ bundler (~> 1.0)
+ railties (= 3.2.8)
+ railties (3.2.8)
+ actionpack (= 3.2.8)
+ activesupport (= 3.2.8)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.0.3)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec-core (2.12.2)
+ rspec-expectations (2.12.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.12.0)
+ rspec-rails (2.12.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec-core (~> 2.12.0)
+ rspec-expectations (~> 2.12.0)
+ rspec-mocks (~> 2.12.0)
+ rubyzip (0.9.9)
+ sass (3.2.3)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ selenium-webdriver (2.27.2)
+ childprocess (>= 0.2.5)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
+ rubyzip
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ thin (1.5.0)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
+ thor (0.16.0)
+ tilt (1.3.3)
+ treetop (1.4.12)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.35)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
+ websocket (1.0.4)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bourbon
+ capybara
+ capybara-webkit
+ coffee-rails (~> 3.2.1)
+ flutie
+ foreman
+ jquery-rails
+ launchy
+ rails (= 3.2.8)
+ rspec-rails
+ sass-rails (~> 3.2.3)
+ thin
+ uglifier (>= 1.0.3)
@@ -0,0 +1,12 @@
+guard 'spork' do
+ watch 'config/application.rb'
+ watch 'config/environment.rb'
+ watch %r{^config/environments/.*\.rb$}
+ watch %r{^config/initializers/.*\.rb$}
+ watch 'config/routes.rb'
+ watch 'Gemfile.lock'
+ watch 'spec/factories.rb'
+ watch 'spec/spec_helper.rb'
+ watch %r{^spec/support/.*\.rb$}
+ watch 'config/locales/.*'
+end
@@ -0,0 +1 @@
+web: bundle exec rails server thin -p $PORT
@@ -0,0 +1,9 @@
+You look great in Suspenders
+============================
+
+Use the following guides for getting things done, programming well, and
+programming in style.
+
+* [Protocol](http://github.com/thoughtbot/guides/blob/master/protocol)
+* [Best Practices](http://github.com/thoughtbot/guides/blob/master/best-practices)
+* [Style](http://github.com/thoughtbot/guides/blob/master/style)
@@ -0,0 +1,18 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Shortstuff::Application.load_tasks
+
+if defined?(RSpec)
+ desc 'Run factory specs.'
+ RSpec::Core::RakeTask.new(:factory_specs) do |t|
+ t.pattern = './spec/models/factories_spec.rb'
+ end
+
+ task spec: :factory_specs
+end
+task(:default).clear
+task :default => [:spec]
No changes.
@@ -0,0 +1,16 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require jquery-ui
+//= require_tree .
@@ -0,0 +1,59 @@
+// clear inputs with starter values
+new function($) {
+ $.fn.prefilledInput = function() {
+
+ var focus = function () {
+ $(this).removeClass('prefilled');
+ if (this.value == this.prefilledValue) {
+ this.value = '';
+ }
+ };
+
+ var blur = function () {
+ if (this.value == '') {
+ $(this).addClass('prefilled').val(this.prefilledValue);
+ } else if (this.value != this.prefilledValue) {
+ $(this).removeClass('prefilled');
+ }
+ };
+
+ var extractPrefilledValue = function () {
+ if (this.title) {
+ this.prefilledValue = this.title;
+ this.title = '';
+ } else if (this.id) {
+ this.prefilledValue = $('label[for=' + this.id + ']').hide().text();
+ }
+ if (this.prefilledValue) {
+ this.prefilledValue = this.prefilledValue.replace(/\*$/, '');
+ }
+ };
+
+ var initialize = function (index) {
+ if (!this.prefilledValue) {
+ this.extractPrefilledValue = extractPrefilledValue;
+ this.extractPrefilledValue();
+ $(this).trigger('blur');
+ }
+ };
+
+ return this.filter(":input").
+ focus(focus).
+ blur(blur).
+ each(initialize);
+ };
+
+ var clearPrefilledInputs = function () {
+ var form = this.form || this;
+ $(form).find("input.prefilled, textarea.prefilled").val("");
+ };
+
+ var prefilledSetup = function () {
+ $('input.prefilled, textarea.prefilled').prefilledInput();
+ $('form').submit(clearPrefilledInputs);
+ $('input:submit, button:submit').click(clearPrefilledInputs);
+ };
+
+ $(document).ready(prefilledSetup);
+ $(document).ajaxComplete(prefilledSetup);
+}(jQuery);
No changes.
@@ -0,0 +1,17 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
+
+
+@import 'flutie';
+@import 'bourbon';
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
No changes.
No changes.
@@ -0,0 +1,7 @@
+class EmailValidator < ActiveModel::EachValidator
+ def validate_each(record, attribute, value)
+ unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
+ record.errors[attribute] << (options[:message] || "is not an email")
+ end
+ end
+end
@@ -0,0 +1,5 @@
+<div id="flash">
+ <% flash.each do |key, value| -%>
+ <div id="flash_<%= key %>"><%= value %></div>
+ <% end -%>
+</div>
Oops, something went wrong.

0 comments on commit f7508c0

Please sign in to comment.