Permalink
Browse files

Add static pages for Success Stories and Contribute

  • Loading branch information...
1 parent 911ca1b commit 01e4e46e3e4eb870eac3bdb7fa1a3fd0bcdc477e @zuhao committed Jun 24, 2012
View
@@ -16,13 +16,13 @@ end
gem 'jquery-rails'
gem 'haml-rails'
-
-gem 'haml'
gem 'execjs'
group :test, :development do
- gem 'rspec-rails', '~> 2.0'
+ gem 'rspec-rails'
+ gem 'guard-rspec'
gem 'capybara'
+ gem 'growl'
end
group :production do
View
@@ -52,6 +52,12 @@ GEM
execjs (1.3.0)
multi_json (~> 1.0)
ffi (1.0.11)
+ growl (1.0.3)
+ guard (1.2.1)
+ listen (>= 0.4.2)
+ thor (>= 0.14.6)
+ guard-rspec (1.1.0)
+ guard (>= 1.1)
haml (3.1.6)
haml-rails (0.3.4)
actionpack (~> 3.0)
@@ -68,6 +74,10 @@ GEM
libv8 (3.3.10.4)
libwebsocket (0.1.3)
addressable
+ listen (0.4.6)
+ rb-fchange (~> 0.0.5)
+ rb-fsevent (~> 0.9.1)
+ rb-inotify (~> 0.8.8)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -99,6 +109,11 @@ GEM
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
+ rb-fchange (0.0.5)
+ ffi
+ rb-fsevent (0.9.1)
+ rb-inotify (0.8.8)
+ ffi (>= 0.5.0)
rdoc (3.12)
json (~> 1.4)
rspec (2.10.0)
@@ -151,11 +166,12 @@ DEPENDENCIES
capybara
coffee-rails (~> 3.2.1)
execjs
- haml
+ growl
+ guard-rspec
haml-rails
jquery-rails
rails (= 3.2.3)
- rspec-rails (~> 2.0)
+ rspec-rails
sass-rails (~> 3.2.3)
sqlite3
therubyracer
View
@@ -0,0 +1,37 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2, :all_after_pass => false 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{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_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('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" }
+
+ # Turnip features and steps
+ watch(%r{^spec/acceptance/(.+)\.feature$})
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
+
+ # Added
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
+ ["spec/routing/#{m[1]}_routing_spec.rb",
+ "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb",
+ "spec/acceptance/#{m[1]}_spec.rb",
+ (m[1][/_pages/] ? "spec/requests/#{m[1]}_spec.rb" :
+ "spec/requests/#{m[1].singularize}_pages_spec.rb")]
+ end
+ watch(%r{^app/views/(.+)/}) do |m|
+ "spec/requests/#{m[1].singularize}_pages_spec.rb"
+ end
+
+end
+
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
+// Place all the styles related to the StaticPages controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,9 @@
+class StaticPagesController < ApplicationController
+ def successes
+ @page_title = 'Success Stories'
+ end
+
+ def contribute
+ @page_title = 'Contribute to make it better'
+ end
+end
@@ -0,0 +1,2 @@
+module StaticPagesHelper
+end
@@ -7,4 +7,6 @@
%h1 Is It Fedora Ruby
%p= link_to 'Ruby gems', rubygems_path
- %p= link_to 'Fedora rpms', fedorarpms_path
+ %p= link_to 'Fedora rpms', fedorarpms_path
+ %p= link_to 'Success Stories', successes_path
+ %p= link_to 'Contribute', contribute_path
@@ -24,7 +24,7 @@
%p= f.label :text, 'Comment'
%p= f.text_area :text
- = f.submit
+ /= f.submit
@@ -0,0 +1,2 @@
+%h1 Contribute to make it better!
+%p Find how to contribute to the Feodra/Ruby community.
@@ -0,0 +1,2 @@
+%h1 Success Stories
+%p Find some of the best-known success stories here!
View
@@ -1,5 +1,8 @@
Isitfedoraruby::Application.routes.draw do
+ get 'successes', :controller => 'static_pages', :action => 'successes'
+ get 'contribute', :controller => 'static_pages', :action => 'contribute'
+
match '/' => 'home#show'
post 'rubygems/:id', :controller => 'gemcomments', :action => 'create'
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe StaticPagesController do
+
+ describe "GET 'successes'" do
+ it "returns http success" do
+ get 'successes'
+ response.should be_success
+ end
+ end
+
+ describe "GET 'contribute'" do
+ it "returns http success" do
+ get 'contribute'
+ response.should be_success
+ end
+ end
+
+end
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the StaticPagesHelper. For example:
+#
+# describe StaticPagesHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe StaticPagesHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe "Static Pages" do
+
+ describe "Success Stories" do
+ it "should have the title 'Success Stories'" do
+ visit '/successes'
+ page.should have_selector('title', :text => 'Success Stories')
+ end
+ # it "should have the content 'Success Stories'" do
+ # visit '/successes'
+ # page.should have_content('Success Stories')
+ # end
+ end
+
+ describe "Contribute" do
+ it "should have the title 'Contribute'" do
+ visit '/contribute'
+ page.should have_selector('title', :text => 'Contribute')
+ end
+ # it "should have the content 'Contribute'" do
+ # visit '/contribute'
+ # page.should have_content('Contribute')
+ # end
+ end
+
+end
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe "static_pages/contribute.html.haml" do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe "static_pages/successes.html.haml" do
+ pending "add some examples to (or delete) #{__FILE__}"
+end

0 comments on commit 01e4e46

Please sign in to comment.