Skip to content

Commit

Permalink
before compass test
Browse files Browse the repository at this point in the history
  • Loading branch information
multiscan committed Dec 19, 2012
1 parent 1e76689 commit adee919
Show file tree
Hide file tree
Showing 13 changed files with 246 additions and 269 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

# Ignore application configuration
/config/application.yml

36 changes: 22 additions & 14 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
source 'https://rubygems.org'

gem 'rails', '3.2.9'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem "rspec-rails", ">= 2.11.4", :group => [:development, :test]
gem "database_cleaner", ">= 0.9.1", :group => :test
gem "email_spec", ">= 1.4.0", :group => :test
gem "cucumber-rails", ">= 1.3.0", :group => :test, :require => false
gem "launchy", ">= 2.1.2", :group => :test
gem "capybara", ">= 2.0.1", :group => :test
gem "factory_girl_rails", ">= 4.1.0", :group => [:development, :test]
gem "bootstrap-sass", ">= 2.1.1.0"
gem "devise", ">= 2.1.2"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.0.4"
gem "quiet_assets", ">= 1.0.1", :group => :development
gem "figaro", ">= 0.5.0"
gem "better_errors", ">= 0.2.0", :group => :development
gem "binding_of_caller", ">= 0.6.8", :group => :development

gem 'haml-rails', :group => :development

gem 'compass'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
Expand All @@ -36,3 +42,5 @@ gem 'jquery-rails'

# To use debugger
# gem 'debugger'


1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@
*= require_self
*= require_tree .
*/
.content {
background-color: #eee;
padding: 20px;
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
@include border-radius(0 0 6px 6px);
@include box-shadow(0 1px 2px rgba(0,0,0,0.15));
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/bootstrap_and_overrides.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "bootstrap";
body { padding-top: 60px; }
@import "bootstrap-responsive";
5 changes: 5 additions & 0 deletions app/views/layouts/_messages.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- flash.each do |name, msg|
- if msg.is_a?(String)
%div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
%a.close{"data-dismiss" => "alert"} ×
= content_tag :div, msg, :id => "flash_#{name}"
10 changes: 10 additions & 0 deletions app/views/layouts/_navigation.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= link_to "Psychopad", root_path, :class => 'brand'
%ul.nav
-if user_signed_in?
%li=link_to('Logout', destroy_user_session_path, :method=>'delete')
%li=link_to('Edit account', edit_user_registration_path)
-if current_user.has_role? :admin
%li= link_to('Admin', users_path)
-else
%li= link_to('Login', new_user_session_path)
%li= link_to('Sign up', new_user_registration_path)
66 changes: 52 additions & 14 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>Psychopad</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>
!!! 5
%html
%head
%meta{:name=>"viewport", :content=>"width=device-width, initial-scale=1.0, maximum-scale=1"}
%title= content_for?(:title) ? yield(:title) : "Psychopad"
%meta{:name=>"description", :content=>content_for?(:description) ? yield(:description) : "Psychopad"}
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
= yield(:head)
%body{:class=>"#{controller_name} #{action_name}"}
%header.navbar.navbar-fixed-top
%nav.navbar-inner
.container
= render 'layouts/navigation'
#main{:role => "main"}
.container
.content
.row
.span12
= render 'layouts/messages'
= yield
%footer






!!!
%html
%head
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"}
%title= content_for?(:title) ? yield(:title) : "App_Name"
%meta{:content => content_for?(:description) ? yield(:description) : "App_Name", :name => "description"}
= stylesheet_link_tag :application, :media => "all"
= javascript_include_tag :application
= csrf_meta_tags
= yield(:head)
%body
%header.navbar.navbar-fixed-top
%nav.navbar-inner
.container
= render 'layouts/navigation'
#main{:role => "main"}
.container
.content
.row
.span12
= render 'layouts/messages'
= yield
%footer
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
59 changes: 59 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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
# # { :except => [:widgets] } may not do what you expect here
# # as tCucumber::Rails::Database.javascript_strategy overrides
# # this setting.
# DatabaseCleaner.strategy = :truncation
# 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

65 changes: 65 additions & 0 deletions lib/tasks/cucumber.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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.


unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks

vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?

begin
require 'cucumber/rake/task'

namespace :cucumber do
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
end

Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'wip'
end

Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
t.binary = vendored_cucumber_bin
t.fork = true # You may get faster startup if you set this to false
t.profile = 'rerun'
end

desc 'Run all features'
task :all => [:ok, :wip]

task :statsetup do
require 'rails/code_statistics'
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
end
end
desc 'Alias for cucumber:ok'
task :cucumber => 'cucumber:ok'

task :default => :cucumber

task :features => :cucumber do
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
end

# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
task 'db:test:prepare' do
end

task :stats => 'cucumber:statsetup'
rescue LoadError
desc 'cucumber rake task not available (cucumber not installed)'
task :cucumber do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end

end
Loading

0 comments on commit adee919

Please sign in to comment.