From 1e907d4cb902ae1ef8459b0245c60b448af2254d Mon Sep 17 00:00:00 2001 From: Cesy Avon Date: Fri, 7 Sep 2012 06:09:48 -0700 Subject: [PATCH 1/2] Fixing failing unit test and making rspec tests the default --- Gemfile.lock | 147 ++++++++++++++++++++++++++++++++++++++++ lib/tasks/testing.rake | 12 ++++ test/fixtures/users.yml | 4 +- 3 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 Gemfile.lock create mode 100644 lib/tasks/testing.rake diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..8f8b5318a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,147 @@ +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) + arel (3.0.2) + bcrypt-ruby (3.0.1) + builder (3.0.2) + 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.3.3) + devise (2.1.2) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.1) + railties (~> 3.1) + warden (~> 1.2.1) + diff-lcs (1.1.3) + erubis (2.7.0) + execjs (1.4.0) + multi_json (~> 1.0) + hike (1.2.1) + i18n (0.6.1) + journey (1.0.4) + jquery-rails (2.1.2) + railties (>= 3.1.0, < 5.0) + thor (~> 0.14) + json (1.7.5) + libv8 (3.3.10.4) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.19) + multi_json (1.3.6) + nokogiri (1.5.5) + orm_adapter (0.4.0) + 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.1) + 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 (0.9.2.2) + rdoc (3.12) + json (~> 1.4) + rspec (2.11.0) + rspec-core (~> 2.11.0) + rspec-expectations (~> 2.11.0) + rspec-mocks (~> 2.11.0) + rspec-core (2.11.1) + rspec-expectations (2.11.3) + diff-lcs (~> 1.1.3) + rspec-mocks (2.11.2) + rspec-rails (2.11.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec (~> 2.11.0) + sass (3.2.1) + sass-rails (3.2.5) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + sprockets (2.1.3) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.6) + therubyracer (0.10.2) + libv8 (~> 3.3.10) + thor (0.16.0) + tilt (1.3.3) + treetop (1.4.10) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.33) + uglifier (1.3.0) + execjs (>= 0.3.0) + multi_json (~> 1.0, >= 1.0.2) + warden (1.2.1) + rack (>= 1.0) + webrat (0.7.3) + nokogiri (>= 1.2.0) + rack (>= 1.0) + rack-test (>= 0.5.3) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (>= 1.1.5) + coffee-rails (~> 3.2.1) + devise + jquery-rails + rails (= 3.2.8) + rspec-rails + sass-rails (~> 3.2.3) + sqlite3 + therubyracer + uglifier (>= 1.0.3) + webrat diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake new file mode 100644 index 000000000..cc082b0be --- /dev/null +++ b/lib/tasks/testing.rake @@ -0,0 +1,12 @@ +require 'rake' +require 'rspec/core/rake_task' + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec + +task :run_tests do + system("rspec spec/") + system("rake test") +end + diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index c63aac0b6..fff91e79d 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -4,7 +4,9 @@ # model remove the '{}' from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -one: {} +one: { + email: test@growstuff.org +} # column: value # two: {} From 5aa3242104ba420af5d6db208040228263db3ec6 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Sun, 9 Sep 2012 20:07:07 +0100 Subject: [PATCH 2/2] Include project description on index page. --- app/views/home/index.html.erb | 6 +++++- spec/view/index_spec.rb | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 720f0b780..1a3b21fd8 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,5 +1,9 @@

Welcome to Growstuff

-

We're a community of gardeners

+

Growstuff is a community of food gardeners working together to build an open +source platform to track, share, and discuss edible gardens and sustainable +lifestyles. You can join us right now and be part of growing our website, from +seed to harvest. We welcome you regardless of your experience, and invite you +to be part of our development process.

<% if user_signed_in? %>

diff --git a/spec/view/index_spec.rb b/spec/view/index_spec.rb index bd2600834..4ab26969f 100644 --- a/spec/view/index_spec.rb +++ b/spec/view/index_spec.rb @@ -19,6 +19,12 @@ describe 'home/index.html.erb', :type => "view" do rendered.should contain 'Log in' end + it 'should have description' do + render + rendered.should contain 'Growstuff is a community of food gardeners' + rendered.should contain 'We welcome you regardless of your experience, and invite you to be part of our development process.' + end + end context "logged in" do @@ -39,5 +45,12 @@ describe 'home/index.html.erb', :type => "view" do render rendered.should contain 'Log out' end + + it 'should have description' do + render + rendered.should contain 'Growstuff is a community of food gardeners' + rendered.should contain 'We welcome you regardless of your experience, and invite you to be part of our development process.' + end + end end