Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pair programming: Event show

  • Loading branch information...
commit 515f6aa255e9a0d3d838d5da8207269a387c76fd 1 parent 6e4ac84
@ruprict authored
View
18 Gemfile
@@ -1,20 +1,20 @@
source 'http://rubygems.org'
-gem 'rails', '3.1.0.rc5'
-gem 'devise', "~> 1.4.2"
-gem 'mongoid', "~> 2.1.8"
+gem 'rails', '3.1.0'
+gem 'devise', "~> 1.4.6"
+gem 'mongoid', "~> 2.2.0"
gem 'mongoid_spacial', "~> 0.2.13"
gem 'haml', '~> 3.1.2'
gem 'haml-rails', '~> 0.3.4'
-gem 'bson_ext', '~> 1.3.1'
+gem 'bson_ext', '~> 1.4.0'
gem 'rails-backbone', "~> 0.5.3"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
- gem 'sass-rails', "~> 3.1.0.rc"
- gem 'coffee-rails', "~> 3.1.0.rc"
+ gem 'sass-rails', "~> 3.1.0"
+ gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
@@ -23,14 +23,16 @@ gem 'jquery-rails'
group :test, :development do
gem 'rspec-rails', '~> 2.6.1'
gem 'mongoid-rspec', '~> 1.4.4'
- gem 'capybara', '~> 1.0.1'
+ gem 'capybara', '~> 1.1.1'
gem 'factory_girl_rails', '~> 1.1.0'
gem 'database_cleaner', '~> 0.6.7'
gem 'jasmine', '~> 1.1.0.rc3'
gem 'hpricot', '~> 0.8.4'
gem 'ruby_parser', '~> 2.2.0'
- gem 'spork', '~> 0.9.0.rc'
+ gem 'spork', '~> 0.9.0.rc9'
gem 'launchy', '~> 2.0.5'
+ gem 'guard-rspec', '~> 0.4.5'
+ gem 'guard-spork', '~> 0.2.1'
end
# Use unicorn as the web server
View
142 Gemfile.lock
@@ -1,62 +1,60 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.0.rc5)
- actionpack (= 3.1.0.rc5)
+ actionmailer (3.1.0)
+ actionpack (= 3.1.0)
mail (~> 2.3.0)
- actionpack (3.1.0.rc5)
- activemodel (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
+ actionpack (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
- rack (~> 1.3.1)
- rack-cache (~> 1.0.2)
- rack-mount (~> 0.8.1)
- rack-test (~> 0.6.0)
- sprockets (~> 2.0.0.beta.12)
- activemodel (3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
- bcrypt-ruby (~> 2.1.4)
+ rack (~> 1.3.2)
+ rack-cache (~> 1.0.3)
+ rack-mount (~> 0.8.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.0.0)
+ activemodel (3.1.0)
+ activesupport (= 3.1.0)
+ bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
- activerecord (3.1.0.rc5)
- activemodel (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
- arel (~> 2.1.4)
+ activerecord (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
+ arel (~> 2.2.1)
tzinfo (~> 0.3.29)
- activeresource (3.1.0.rc5)
- activemodel (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
- activesupport (3.1.0.rc5)
+ activeresource (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
+ activesupport (3.1.0)
multi_json (~> 1.0)
addressable (2.2.6)
- arel (2.1.4)
- bcrypt-ruby (2.1.4)
- bson (1.3.1)
- bson_ext (1.3.1)
+ arel (2.2.1)
+ bcrypt-ruby (3.0.1)
+ bson (1.4.0)
+ bson_ext (1.4.0)
builder (3.0.0)
- capybara (1.0.1)
+ capybara (1.1.1)
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)
- childprocess (0.2.1)
+ childprocess (0.2.2)
ffi (~> 1.0.6)
- coffee-rails (3.1.0.rc.5)
- actionpack (~> 3.1.0.rc1)
+ coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
- railties (~> 3.1.0.rc1)
- sprockets (>= 2.0.0.beta.9)
+ railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
database_cleaner (0.6.7)
- devise (1.4.2)
- bcrypt-ruby (~> 2.1.2)
+ devise (1.4.6)
+ bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.0.3)
diff-lcs (1.1.2)
@@ -69,13 +67,20 @@ GEM
factory_girl (~> 2.0.0)
railties (>= 3.0.0)
ffi (1.0.9)
+ guard (0.7.0)
+ thor (~> 0.14.6)
+ guard-rspec (0.4.5)
+ guard (>= 0.4.0)
+ guard-spork (0.2.1)
+ guard (>= 0.2.2)
+ spork (>= 0.8.4)
haml (3.1.2)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
- hike (1.2.0)
+ hike (1.2.1)
hpricot (0.8.4)
i18n (0.6.0)
jasmine (1.1.0.rc3)
@@ -87,7 +92,7 @@ GEM
jquery-rails (1.0.13)
railties (~> 3.0)
thor (~> 0.14)
- json_pure (1.5.3)
+ json_pure (1.6.1)
launchy (2.0.5)
addressable (~> 2.2.6)
mail (2.3.0)
@@ -95,9 +100,9 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
- mongo (1.3.1)
- bson (>= 1.3.1)
- mongoid (2.1.8)
+ mongo (1.4.0)
+ bson (= 1.4.0)
+ mongoid (2.2.0)
activemodel (~> 3.0)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
@@ -111,36 +116,36 @@ GEM
nokogiri (1.5.0)
orm_adapter (0.0.5)
polyglot (0.3.2)
- rack (1.3.2)
- rack-cache (1.0.2)
+ rack (1.3.4)
+ rack-cache (1.0.3)
rack (>= 0.4)
- rack-mount (0.8.2)
+ rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
- 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)
+ rails (3.1.0)
+ actionmailer (= 3.1.0)
+ actionpack (= 3.1.0)
+ activerecord (= 3.1.0)
+ activeresource (= 3.1.0)
+ activesupport (= 3.1.0)
bundler (~> 1.0)
- railties (= 3.1.0.rc5)
+ railties (= 3.1.0)
rails-backbone (0.5.3)
coffee-script (~> 2.2.0)
ejs (~> 1.0.0)
rails (~> 3.1.0.rc5)
- railties (3.1.0.rc5)
- actionpack (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
+ railties (3.1.0)
+ actionpack (= 3.1.0)
+ activesupport (= 3.1.0)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
- rdoc (3.9.2)
+ rdoc (3.9.4)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
@@ -158,24 +163,25 @@ GEM
sexp_processor (~> 3.0)
rubyzip (0.9.4)
sass (3.1.7)
- sass-rails (3.1.0.rc.5)
- actionpack (~> 3.1.0.rc1)
- railties (~> 3.1.0.rc1)
+ sass-rails (3.1.2)
+ actionpack (~> 3.1.0)
+ railties (~> 3.1.0)
sass (>= 3.1.4)
- sprockets (>= 2.0.0.beta.9)
- selenium-webdriver (2.4.0)
+ sprockets (~> 2.0.0)
+ tilt (~> 1.3.2)
+ selenium-webdriver (2.8.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
rubyzip
sexp_processor (3.0.6)
spork (0.9.0.rc9)
- sprockets (2.0.0.beta.13)
+ sprockets (2.0.0)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
thor (0.14.6)
- tilt (1.3.2)
+ tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
@@ -192,25 +198,27 @@ PLATFORMS
ruby
DEPENDENCIES
- bson_ext (~> 1.3.1)
- capybara (~> 1.0.1)
- coffee-rails (~> 3.1.0.rc)
+ bson_ext (~> 1.4.0)
+ capybara (~> 1.1.1)
+ coffee-rails (~> 3.1.0)
database_cleaner (~> 0.6.7)
- devise (~> 1.4.2)
+ devise (~> 1.4.6)
factory_girl_rails (~> 1.1.0)
+ guard-rspec (~> 0.4.5)
+ guard-spork (~> 0.2.1)
haml (~> 3.1.2)
haml-rails (~> 0.3.4)
hpricot (~> 0.8.4)
jasmine (~> 1.1.0.rc3)
jquery-rails
launchy (~> 2.0.5)
- mongoid (~> 2.1.8)
+ mongoid (~> 2.2.0)
mongoid-rspec (~> 1.4.4)
mongoid_spacial (~> 0.2.13)
- rails (= 3.1.0.rc5)
+ rails (= 3.1.0)
rails-backbone (~> 0.5.3)
rspec-rails (~> 2.6.1)
ruby_parser (~> 2.2.0)
- sass-rails (~> 3.1.0.rc)
- spork (~> 0.9.0.rc)
+ sass-rails (~> 3.1.0)
+ spork (~> 0.9.0.rc9)
uglifier
View
25 Guardfile
@@ -0,0 +1,25 @@
+guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch(%r{^config/environments/.+\.rb$})
+ watch(%r{^config/initializers/.+\.rb$})
+ watch('spec/spec_helper.rb')
+end
+
+guard 'rspec', :version => 2 do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('spec/spec_helper.rb') { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ # Capybara request specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
+end
View
4 app/controllers/events_controller.rb
@@ -4,6 +4,10 @@ class EventsController < ApplicationController
def index
@events = current_user.events
end
+
+ def show
+ @event = current_user.events.find(params[:id])
+ end
def create
event = current_user.events.build(params[:event])
View
2  app/views/devise/sessions/new.html.haml
@@ -1,4 +1,4 @@
-- content_for(:title, 'Sign In')
+- title('Sign In')
%h2 Sign in
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%p
View
2  app/views/events/index.html.haml
@@ -7,6 +7,8 @@
=button_to "X", event, :confirm => "Are you sure?", :method => :delete
%span.event_name
= link_to event.name, edit_event_path(event)
+ %span.event_details
+ = link_to "Show Details", event_path(event)
%span.event_description= event.description
%div.clear
= form_for @event || Event.new do |f|
View
2  app/views/events/show.html.haml
@@ -0,0 +1,2 @@
+%h2= @event.name
+.description= @event.description
View
2  spec/acceptance/add_events_spec.rb
@@ -11,7 +11,7 @@
fill_in "Name", :with => "New Event"
fill_in "Description", :with => "This is my new event"
click_button "Create Event"
- page.current_path == events_path
+ page.current_path.should == events_path
page.should have_content("New Event")
page.should have_content("This is my new event")
page.should have_selector("ul > li")
View
21 spec/acceptance/show_event_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+feature 'Show Event', %q{
+ As a registered user
+ I want to see an Event
+ so I can see my Event Details
+} do
+
+ background do
+ @user = Factory(:user)
+ @event = Factory(:event, :user => @user )
+ login_user @user
+ end
+
+ scenario "Show Event" do
+ click_link "Show Details"
+ page.current_path.should == event_path(@event)
+ page.should have_content(@event.name)
+ page.should have_content(@event.description)
+ end
+end
View
2  spec/factories.rb
@@ -1,5 +1,3 @@
-require 'factory_girl'
-
FactoryGirl.define do
factory :user do
name 'Testy'

0 comments on commit 515f6aa

Please sign in to comment.
Something went wrong with that request. Please try again.