#Install instructions and Demo notes
git clone git@github.com:wycats/jquery-governance
bundle
rake setup
This will populate the db with several members and motions in various states.
#Install instructions and Demo notes
git clone git@github.com:wycats/jquery-governance
bundle
rake setup
This will populate the db with several members and motions in various states.
module RSpec | |
module Rails | |
module ViewRendering | |
PathSetDelegatorResolver.class_eval do | |
def find_all(path, prefix, *args) | |
path_set.find_all(path, [prefix],*args).collect do |template| | |
::ActionView::Template.new( | |
"", | |
template.identifier, | |
template.handler, |
Failures: | |
1) MotionsController#new with member logged in should set memeber id | |
Failure/Error: get :new | |
Could not render layout: undefined method `each' for "layouts":String | |
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:347:in `rescue in _default_layout' | |
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:344:in `_default_layout' | |
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:323:in `_layout_for_option' | |
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/abstract_controller/layouts.rb:290:in `_normalize_options' | |
# /home/chopper/.rvm/gems/ruby-1.9.2-p0@jquery-governance/bundler/gems/rails-eb1e727544d9/actionpack/lib/action_controller/metal/rendering.rb:40:in `_nor |
describe "email notifications" do | |
before(:each) do | |
# Disable database hits for speed, we're only interested in whether the callbacks fire | |
# Joseph DelCioppio - Using PG this breaks the specs, most likely because motions are being created. | |
# In the interest of getting the project done first and foremost I'm removing it. | |
# ActiveRecord::Base.connection.stub(:execute) | |
@member_1 = Factory.stub(:member, :email => "member1@email.com") | |
@member_2 = Factory.stub(:member, :email => "member2@email.com") | |
Membership.stub(:members_active_at).and_return([@member_1, @member_2]) |
class ActiveMembership < ActiveRecord::Base | |
belongs_to :member | |
belongs_to :qualifying_motion, :class_name => "Motion", | |
:foreign_key => :qualifying_motion_id | |
belongs_to :disqualifying_motion, :class_name => "Motion", | |
:foreign_key => :disqualifying_motion_id | |
validates :qualifying_motion, :presence => true |
class ActiveMembership < ActiveRecord::Base | |
belongs_to :member | |
has_many :active_membership_motions | |
has_one :qualifying_motion, :through => :active_membership_motions, | |
:source => :motion, | |
:conditions => {:active_membership_motions => {:qualifying => true}} | |
has_one :disqualifying_motion, :through => :active_membership_motions, |
class Motion < ActiveRecord::Base | |
validates_inclusion_of :state, :in => | |
%w(waitingsecond waitingexpedited waitingobjection | |
objected voting passed failed approved).push(nil) | |
belongs_to :member | |
has_many :events | |
has_many :motion_conflicts | |
has_many :conflicts, :through => :motion_conflicts |
rspec spec/routing/pages_routing_spec.rb -d | |
.F. | |
Failures: | |
1) PagesController routing when no user is signed in routes the root route to pages#home | |
Failure/Error: { :get => '/' }.should route_to(:controller => "pages", :action => "home") | |
The recognized options <{"action"=>"show", "id"=>"master", "controller"=>"lists"}> did not match <{"action"=>"home", "controller"=>"pages"}>, difference: <{"action"=>"home", "id"=>"master", "controller"=>"pages"}> | |
# ./spec/routing/pages_routing_spec.rb:13 | |
Finished in 0.43641 seconds |
require 'lib/root_constraints' | |
Tuhmayta::Application.routes.draw do | |
get "pages/home" | |
constraints(RootConstraints) do | |
root :controller => "lists", :action => "show", :id => "master" | |
end |