Skip to content

Commit

Permalink
Ignored .sw* files, created an initial pages layout and initial tests…
Browse files Browse the repository at this point in the history
… with cucumber.
  • Loading branch information
luizfonseca committed Dec 21, 2011
1 parent be69f69 commit e871da4
Show file tree
Hide file tree
Showing 35 changed files with 407 additions and 67 deletions.
Binary file modified .Gemfile.swp
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

.sw*
/temp
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ source 'http://rubygems.org'
gem 'rails', '3.1.3'

gem 'pg'
gem 'foreigner'
gem 'cancan'
gem 'activeadmin'
gem 'simple_form'

# Frontend stuff
gem 'compass'
gem 'compass-960-plugin'
gem 'slim'

# For heroku
Expand All @@ -17,6 +19,7 @@ gem 'heroku'


group :development, :test do
gem 'cucumber-rails'
gem 'rspec-rails'
gem 'factory_girl'
gem 'capybara'
Expand Down
21 changes: 20 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ GEM
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-960-plugin (0.10.4)
compass (>= 0.10.0)
cucumber (1.1.4)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.7.1)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.2.1)
capybara (>= 1.1.2)
cucumber (>= 1.1.3)
nokogiri (>= 1.5.0)
devise (1.5.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
Expand All @@ -76,11 +88,15 @@ GEM
activesupport
fastercsv (1.5.4)
ffi (1.0.11)
foreigner (1.1.1)
activerecord (>= 3.0.0)
formtastic (1.2.4)
actionpack (>= 2.3.7)
activesupport (>= 2.3.7)
i18n (~> 0.4)
fssm (0.2.7)
gherkin (2.7.1)
json (>= 1.4.6)
has_scope (0.5.1)
heroku (2.15.3)
launchy (>= 0.3.2)
Expand Down Expand Up @@ -184,7 +200,7 @@ GEM
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
tilt (~> 1.1, != 1.3.0)
temple (0.3.4)
term-ansicolor (1.0.7)
thor (0.14.6)
Expand All @@ -210,7 +226,10 @@ DEPENDENCIES
capybara
coffee-rails (~> 3.1.1)
compass
compass-960-plugin
cucumber-rails
factory_girl
foreigner
heroku
jquery-rails
pg
Expand Down
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/application.css.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import compass
@import _blueprint
@import compass/reset
//= require_self
//= require_tree .
Binary file added app/controllers/.pages_controller.rb.swp
Binary file not shown.
6 changes: 6 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class PagesController < ApplicationController

def ideas_more_active

end
end
Binary file added app/views/layouts/._filters.html.slim.swp
Binary file not shown.
Binary file added app/views/layouts/.application.html.slim.swp
Binary file not shown.
15 changes: 15 additions & 0 deletions app/views/layouts/_filters.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.navigation
h3 Navegue nas ideias

h4 Por estatísticas
ul
li
a[href=""] Mais populares
li Recém iniciadas
li Recentemente alteradas

h4 Por categoria
ul
li Mobilidade urbana
li Violência
li Catástrofes naturais
17 changes: 17 additions & 0 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DOCTYPE
html
head
title Festival de Ideias
= stylesheet_link_tag "application"
= javascript_include_tag "application"
= csrf_meta_tags
body
header

.body
aside
= render :partial => "layouts/filters"
section
= yield

footer
Binary file not shown.
45 changes: 45 additions & 0 deletions app/views/pages/ideas_more_active.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
h1 Ideias populares

ol.more_active
li
.badge
img[alt="Badge" title="badge" src=""]
h2 Circuito de webcam entre vizinhos
span Iniciada por Maria Chica
p
Lorem ipsum sit amet, consecteur

a.button[href=""]
|Conheça e contribua
.stats
.like_count 45
.people_count 3


li
.badge
img[alt="Badge" title="badge" src=""]
h2 Circuito de webcam entre vizinhos
span Iniciada por Maria Chica
p
Lorem ipsum sit amet, consecteur

a.button[href=""]
|Conheça e contribua
.stats
.like_count 45
.people_count 3

li
.badge
img[alt="Badge" title="badge" src=""]
h2 Circuito de webcam entre vizinhos
span Iniciada por Maria Chica
p
Lorem ipsum sit amet, consecteur

a.button[href=""]
|Conheça e contribua
.stats
.like_count 45
.people_count 3
Binary file added config/.application.rb.swp
Binary file not shown.
Binary file added config/.database.yml.swp
Binary file not shown.
Binary file added config/.routes.rb.swp
Binary file not shown.
5 changes: 5 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ class Application < Rails::Application

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.generators.stylesheet_engine = :sass

config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
config.sass.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/blueprint/stylesheets"
config.sass.load_paths << "#{Gem.loaded_specs['compass-960-plugin'].full_gem_path}/stylesheets"
end
end
8 changes: 8 additions & 0 deletions config/cucumber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
15 changes: 2 additions & 13 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development: &defaults
adapter: postgresql
host: localhost
username: runeroniek
database: meu_rio_development

frontend:
<<: *defaults

database: festival_ideias_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
<<: *defaults
database: meu_rio_test


database: festival_ideias_test
cucumber:
<<: *test
Binary file added config/environments/.production.rb.swp
Binary file not shown.
54 changes: 1 addition & 53 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,58 +1,6 @@
FestivalDeIdeias::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.

# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action

# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
match '/ideas/mais-colaboradas' => "pages#ideas_more_active", :as => :ideas_more_active

# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products

# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end

# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end

# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end

# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'

# See how all your routes lay out with "rake routes"

# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
end
Binary file added features/.ideas_more_active.feature.swp
Binary file not shown.
9 changes: 9 additions & 0 deletions features/ideas_more_active.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: View more active Ideas
In order to participate in more active ideas
As a visitor
I want to view a selection of the more active ideas

Scenario: View a selection of active ideas
Given I'm in the more active ideas page
Then I should see "Ideias mais colaboradas"

Binary file not shown.
7 changes: 7 additions & 0 deletions features/step_definitions/ideas_more_active_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Given /^I'm in the more active ideas page$/ do
visit ideas_more_active_path
end

Then /^I should see (\w+) $/ do
page.should have_content("Ideias mais colaboradas")
end
Binary file added features/support/.env.rb.swp
Binary file not shown.
56 changes: 56 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.

require 'cucumber/rails'

# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
# order to ease the transition to Capybara we set the default here. If you'd
# prefer to use XPath just remove this line and adjust any selectors in your
# steps to use the XPath syntax.
Capybara.default_selector = :css

# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
# your application behaves in the production environment, where an error page will
# be rendered instead.
#
# Sometimes we want to override this default behaviour and allow Rails to rescue
# exceptions and display an error page (just like when the app is running in production).
# Typical scenarios where you want to do this is when you test your error pages.
# There are two ways to allow Rails to rescue exceptions:
#
# 1) Tag your scenario (or feature) with @allow-rescue
#
# 2) Set the value below to true. Beware that doing this globally is not
# recommended as it will mask a lot of errors for you!
#
ActionController::Base.allow_rescue = false

# Remove/comment out the lines below if your app doesn't have a database.
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
begin
DatabaseCleaner.strategy = :transaction
rescue NameError
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end

# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
# See the DatabaseCleaner documentation for details. Example:
#
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
# end
#
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
# DatabaseCleaner.strategy = :transaction
# end
#

# Possible values are :truncation and :transaction
# The :transaction strategy is faster, but might give you threading problems.
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
Cucumber::Rails::Database.javascript_strategy = :truncation

Loading

0 comments on commit e871da4

Please sign in to comment.