Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: threefunkymonkeys/pair.me
base: 06cc0c8a00
...
head fork: threefunkymonkeys/pair.me
compare: 13544c6558
Checking mergeability… Don't worry, you can still create the pull request.
  • 8 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
2  .rvmrc
@@ -1 +1 @@
-rvm 1.9.2@pair_me --create
+rvm use 1.9.2-p290@pair_me --create
View
18 Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-gem 'rails', '3.1.0.rc4'
+gem 'rails', '3.1.0.rc5'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -16,26 +16,22 @@ gem 'jquery-rails'
gem 'haml-rails'
-# Use unicorn as the web server
-# gem 'unicorn'
-
-# Deploy with Capistrano
-# gem 'capistrano'
-
-# To use debugger
-# gem 'ruby-debug19', :require => 'ruby-debug'
-
gem 'em-websocket', '0.3.0'
group :test, :development do
+ gem 'ruby-debug19'
+ gem 'rb-inotify'
+ gem 'libnotify'
gem 'wirble'
gem 'hirb'
gem 'interactive_editor'
gem 'rspec-rails'
+ gem 'spork', '~> 0.9.0.rc'
end
group :test do
# Pretty printed test output
gem 'guard-rspec'
- gem 'capybara'
+ #gem 'capybara'
+ gem 'webrat'
gem 'summoner'
end
View
140 Gemfile.lock
@@ -1,60 +1,52 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.0.rc4)
- actionpack (= 3.1.0.rc4)
+ actionmailer (3.1.0.rc5)
+ actionpack (= 3.1.0.rc5)
mail (~> 2.3.0)
- actionpack (3.1.0.rc4)
- activemodel (= 3.1.0.rc4)
- activesupport (= 3.1.0.rc4)
+ actionpack (3.1.0.rc5)
+ activemodel (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
- rack (~> 1.3.0)
- rack-cache (~> 1.0.1)
+ rack (~> 1.3.1)
+ rack-cache (~> 1.0.2)
rack-mount (~> 0.8.1)
rack-test (~> 0.6.0)
- sprockets (~> 2.0.0.beta.10)
- tzinfo (~> 0.3.27)
- activemodel (3.1.0.rc4)
- activesupport (= 3.1.0.rc4)
+ sprockets (~> 2.0.0.beta.12)
+ activemodel (3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
bcrypt-ruby (~> 2.1.4)
builder (~> 3.0.0)
i18n (~> 0.6)
- activerecord (3.1.0.rc4)
- activemodel (= 3.1.0.rc4)
- activesupport (= 3.1.0.rc4)
- arel (~> 2.1.1)
- tzinfo (~> 0.3.27)
- activeresource (3.1.0.rc4)
- activemodel (= 3.1.0.rc4)
- activesupport (= 3.1.0.rc4)
- activesupport (3.1.0.rc4)
+ activerecord (3.1.0.rc5)
+ activemodel (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ arel (~> 2.1.4)
+ tzinfo (~> 0.3.29)
+ activeresource (3.1.0.rc5)
+ activemodel (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ activesupport (3.1.0.rc5)
multi_json (~> 1.0)
addressable (2.2.6)
- arel (2.1.1)
+ archive-tar-minitar (0.5.2)
+ arel (2.1.4)
bcrypt-ruby (2.1.4)
builder (3.0.0)
- capybara (1.0.0)
- mime-types (>= 1.16)
- nokogiri (>= 1.3.3)
- rack (>= 1.0.0)
- rack-test (>= 0.5.4)
- selenium-webdriver (~> 0.2.0)
- xpath (~> 0.1.4)
- childprocess (0.2.0)
- ffi (~> 1.0.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.1)
+ columnize (0.3.4)
diff-lcs (1.1.2)
em-websocket (0.3.0)
addressable (>= 2.1.1)
eventmachine (>= 0.12.9)
erubis (2.7.0)
eventmachine (0.12.10)
- execjs (1.2.0)
+ execjs (1.2.1)
multi_json (~> 1.0)
ffi (1.0.9)
guard (0.5.1)
@@ -67,7 +59,7 @@ GEM
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
- hike (1.1.0)
+ hike (1.2.0)
hirb (0.4.5)
i18n (0.6.0)
interactive_editor (0.0.8)
@@ -75,7 +67,9 @@ GEM
jquery-rails (1.0.12)
railties (~> 3.0)
thor (~> 0.14)
- json_pure (1.5.3)
+ libnotify (0.5.7)
+ linecache19 (0.5.12)
+ ruby_core_source (>= 0.1.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -83,33 +77,35 @@ GEM
mime-types (1.16)
multi_json (1.0.3)
nokogiri (1.5.0)
- polyglot (0.3.1)
- rack (1.3.0)
+ polyglot (0.3.2)
+ rack (1.3.2)
rack-cache (1.0.2)
rack (>= 0.4)
rack-mount (0.8.1)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
- rack-test (0.6.0)
+ rack-test (0.6.1)
rack (>= 1.0)
- rails (3.1.0.rc4)
- actionmailer (= 3.1.0.rc4)
- actionpack (= 3.1.0.rc4)
- activerecord (= 3.1.0.rc4)
- activeresource (= 3.1.0.rc4)
- activesupport (= 3.1.0.rc4)
+ rails (3.1.0.rc5)
+ actionmailer (= 3.1.0.rc5)
+ actionpack (= 3.1.0.rc5)
+ activerecord (= 3.1.0.rc5)
+ activeresource (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
bundler (~> 1.0)
- railties (= 3.1.0.rc4)
- railties (3.1.0.rc4)
- actionpack (= 3.1.0.rc4)
- activesupport (= 3.1.0.rc4)
+ railties (= 3.1.0.rc5)
+ railties (3.1.0.rc5)
+ actionpack (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
- rdoc (3.6.1)
+ rb-inotify (0.8.5)
+ ffi (>= 0.5.0)
+ rdoc (3.8)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
@@ -123,42 +119,49 @@ GEM
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
- rubyzip (0.9.4)
- sass (3.1.3)
- sass-rails (3.1.0.rc.2)
+ ruby-debug-base19 (0.11.25)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
+ ruby_core_source (0.1.5)
+ archive-tar-minitar (>= 0.5.2)
+ sass (3.1.5)
+ sass-rails (3.1.0.rc.5)
actionpack (~> 3.1.0.rc1)
railties (~> 3.1.0.rc1)
- sass (>= 3.1.2)
+ sass (>= 3.1.4)
sprockets (>= 2.0.0.beta.9)
- selenium-webdriver (0.2.2)
- childprocess (>= 0.1.9)
- ffi (>= 1.0.7)
- json_pure
- rubyzip
spoon (0.0.1)
- sprockets (2.0.0.beta.10)
- hike (~> 1.0)
+ spork (0.9.0.rc9)
+ sprockets (2.0.0.beta.12)
+ hike (~> 1.2)
rack (~> 1.0)
- tilt (!= 1.3.0, ~> 1.1)
- sqlite3 (1.3.3)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.4)
summoner (0.1.4)
thor (0.14.6)
tilt (1.3.2)
- treetop (1.4.9)
+ treetop (1.4.10)
+ polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.28)
+ tzinfo (0.3.29)
uglifier (1.0.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
+ webrat (0.7.3)
+ nokogiri (>= 1.2.0)
+ rack (>= 1.0)
+ rack-test (>= 0.5.3)
wirble (0.1.3)
- xpath (0.1.4)
- nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
- capybara
coffee-script
em-websocket (= 0.3.0)
guard-rspec
@@ -166,10 +169,15 @@ DEPENDENCIES
hirb
interactive_editor
jquery-rails
- rails (= 3.1.0.rc4)
+ libnotify
+ rails (= 3.1.0.rc5)
+ rb-inotify
rspec-rails
+ ruby-debug19
sass-rails (~> 3.1.0.rc)
+ spork (~> 0.9.0.rc)
sqlite3
summoner
uglifier
+ webrat
wirble
View
6 app/assets/stylesheets/home.css.sass
@@ -2,12 +2,6 @@
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
-//=border-radius($radius)
- //-moz-border-radius: $radius
- //-webkit-border-radius: $radius
- //-webkit-background-clip: padding-box
-
-
@import "mixins"
@import "font_faces"
View
4 app/controllers/application_controller.rb
@@ -1,6 +1,10 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+ def require_user
+ redirect_to login_path unless current_user
+ end
+
private
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
View
2  app/controllers/home_controller.rb
@@ -1,4 +1,6 @@
class HomeController < ApplicationController
+ before_filter :require_user
+
def index
end
end
View
2  app/views/sessions/new.html.haml
@@ -10,4 +10,4 @@
= password_field_tag :password
.actions
- = submit_tag "Log In"
+ = submit_tag "Log In", :id => :login
View
26 spec/requests/users_login_spec.rb
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+describe "Request Login" do
+
+ context "Anonymous user" do
+
+ before do
+ visit logout_path
+ end
+
+ it "should ask to login if anonymous user tries to access homepage" do
+ visit root_path
+ current_path.should == login_path
+ end
+
+ it "should go to homepage after login" do
+
+ Summoner.summon(:user, :email => "donald@duck.com", :password => "cuack")
+
+ visit "/sessions/new"
+ fill_in :email, :with => "donald@duck.com"
+ fill_in :password, :with => "cuack"
+ click "login"
+ end
+ end
+end
View
100 spec/spec_helper.rb
@@ -1,27 +1,79 @@
-# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-require 'rspec/rails'
-require 'capybara/rspec'
-require File.dirname(__FILE__) + "/beasts"
-
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+require 'rubygems'
+require 'spork'
-RSpec.configure do |config|
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+Spork.prefork do
+ # Loading more in this block will cause your tests to run faster. However,
+ # if you change any configuration or code from libraries loaded here, you'll
+ # need to restart spork for it take effect.
#
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
-
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, remove the following line or assign false
- # instead of true.
- config.use_transactional_fixtures = true
- config.include(Authentication)
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
+ ENV["RAILS_ENV"] ||= 'test'
+ require File.expand_path("../../config/environment", __FILE__)
+ require 'rspec/rails'
+ #require 'capybara/rspec'
+
+ # Requires supporting ruby files with custom matchers and macros, etc,
+ # in spec/support/ and its subdirectories.
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+ RSpec.configure do |config|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
+ config.include(Authentication)
+ end
+
+ Webrat.configure do |config|
+ config.mode = :rails
+ end
+
end
+
+Spork.each_run do
+ # This code will be run each time you run your specs.
+end
+
+require File.dirname(__FILE__) + "/beasts"
+
+# --- Instructions ---
+# Sort the contents of this file into a Spork.prefork and a Spork.each_run
+# block.
+#
+# The Spork.prefork block is run only once when the spork server is started.
+# You typically want to place most of your (slow) initializer code in here, in
+# particular, require'ing any 3rd-party gems that you don't normally modify
+# during development.
+#
+# The Spork.each_run block is run each time you run your specs. In case you
+# need to load files that tend to change during development, require them here.
+# With Rails, your application modules are loaded automatically, so sometimes
+# this block can remain empty.
+#
+# Note: You can modify files loaded *from* the Spork.each_run block without
+# restarting the spork server. However, this file itself will not be reloaded,
+# so if you change any of the code inside the each_run block, you still need to
+# restart the server. In general, if you have non-trivial code in this file,
+# it's advisable to move it into a separate file so you can easily edit it
+# without restarting spork. (For example, with RSpec, you could move
+# non-trivial code into a file spec/support/my_helper.rb, making sure that the
+# spec/support/* files are require'd from inside the each_run block.)
+#
+# Any code that is left outside the two blocks will be run during preforking
+# *and* during each_run -- that's probably not what you want.
+#
+# These instructions should self-destruct in 10 seconds. If they don't, feel
+# free to delete them.
+
+
+
+
View
19 spec/support/acceptance.rb
@@ -0,0 +1,19 @@
+def click(finder)
+ begin
+ click_link finder
+ rescue Webrat::NotFoundError
+ click_button finder
+ end
+end
+
+def current_path
+ request.path
+end
+
+def page
+ response.body
+end
+
+class String
+ alias_method :has_content?, :include?
+end

No commit comments for this range

Something went wrong with that request. Please try again.