This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cuke/ | |
features/ | |
admin/ | |
media/ | |
messages/ | |
base.feature | |
county_selection.feature | |
medium_types/ | |
mime_types/ | |
user/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'model_helper' | |
describe Medium do | |
describe "verifying database columns" do | |
should_have_column :type, :type => :string, :null => false | |
should_have_column :mime_type_id, :type => :integer, :null => false | |
should_have_column :added_by_user_id, :type => :integer, :null => false | |
should_have_column :name, :type => :string, :null => false | |
should_have_column :description, :type => :string | |
should_have_column :path, :type => :string, :null => false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How I would have done it last week | |
describe 'post :create' do | |
context 'with correct email and password' do | |
before :each do | |
email = '[email protected]' | |
password = 'password' | |
@user_id = 1 | |
User.should_receive(:authenticate).with(email, password).and_return([@user_id, Messages::LOGIN_SUCCESSFUL]) | |
post :create, {:email => email, :password => password} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/controllers/admin/messages_controller.rb | |
def stub_user(is_administrator) | |
user = stub_model(User) | |
# because the application is going to call is_administrator in a before filter | |
user.stub(:is_administrator).and_return(is_administrator) | |
# because the application is going to call find_by_id in a before filter | |
User.stub(:find_by_id).and_return(user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/features/installing_culerity.feature b/features/installing_culerity.feature | |
index 9bdfea5..856f406 100644 | |
--- a/features/installing_culerity.feature | |
+++ b/features/installing_culerity.feature | |
@@ -5,8 +5,8 @@ Feature: Installing culerity | |
Background: | |
Given a Rails app | |
- And I run executable "script/generate" with arguments "cucumber" | |
- And I delete file "features/step_definitions/webrat_steps.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Installing culerity | |
In order to not have to use f@#$ing selenium and receive hate into our lives | |
As a self-respective Rails/JavaScript developer | |
I want to install culerity into my Rails app | |
Background: | |
Given a Rails app | |
And I run executable "script/generate" with arguments "cucumber" | |
And I delete file "features/step_definitions/webrat_steps.rb" | |
And I delete file "features/support/env.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/environments/development.rb | |
# add this line | |
config.action_mailer.delivery_method = :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'culerity' | |
$env_javascript_tag = ENV['CULERITY_JAVASCRIPT_TAG'] || '@javascript' | |
def set_jruby_env | |
rvm_jruby = ENV['CULERITY_RVM_JRUBY'] || 'jruby' | |
info = `rvm info #{rvm_jruby}` | |
gem_home = info =~ /GEM_HOME:\s?"([^"]*)"/ ? $1 : '' | |
gem_path = info =~ /GEM_PATH:\s?"([^"]*)"/ ? $1 : '' | |
my_ruby_home = info =~ /MY_RUBY_HOME:\s?"([^"]*)"/ ? $1 : '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/opt/jruby/current/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require': no such file to load -- celerity (LoadError) | |
from /opt/jruby/current/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' | |
from /Users/phillip/.rvm/gems/ree-1.8.6-20090610/gems/culerity-0.2.9/lib/culerity/celerity_server.rb:2 | |
from /Users/phillip/.rvm/gems/ree-1.8.6-20090610/gems/culerity-0.2.9/lib/culerity/celerity_server.rb:47:in `require' | |
from /Users/phillip/.rvm/gems/ree-1.8.6-20090610/gems/culerity-0.2.9/lib/culerity.rb:47 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake log:clear > /dev/null | |
rake culerity:rails:stop > /dev/null | |
rm tmp/culerity_rails_server.pid &> /dev/null | |
rake culerity:rails:start > /dev/null | |
ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-0.6.2/lib:lib" -S rcov --rails | |
--exclude gems\/,spec\/,cuke\/,/Users/phillip/Development/Library/git/philerity\/ |