90 |
91 |
92 |
93 |
94 |
119 |
120 |
121 |
122 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/app/views/motions/_form.html.haml:
--------------------------------------------------------------------------------
1 | = form_for @motion do |f|
2 | - if @motion.errors.any?
3 | #error_explanation
4 | %h2= "#{pluralize(@motion.errors.count, "error")} prohibited this motion from being saved:"
5 | %ul
6 | - @motion.errors.full_messages.each do |msg|
7 | %li= msg
8 |
9 | .field
10 | = f.label :organization
11 | = f.text_field :organization
12 | .field
13 | = f.label :context
14 | = f.text_field :context
15 | .field
16 | = f.label :creator
17 | = f.text_field :creator
18 | .field
19 | = f.label :text
20 | = f.text_field :text
21 | .field
22 | = f.label :date
23 | = f.datetime_select :date
24 | .field
25 | = f.label :requirement
26 | = f.text_field :requirement
27 | .field
28 | = f.label :result
29 | = f.text_field :result
30 | .field
31 | = f.label :session
32 | = f.text_field :session
33 | .actions
34 | = f.submit 'Save'
35 |
--------------------------------------------------------------------------------
/app/views/motions/edit.html.haml:
--------------------------------------------------------------------------------
1 | %h1 Editing motion
2 |
3 | = render 'form'
4 |
5 | = link_to 'Show', @motion
6 | \|
7 | = link_to 'Back', motions_path
8 |
--------------------------------------------------------------------------------
/app/views/motions/index.html.haml:
--------------------------------------------------------------------------------
1 | %h1 Listing motions
2 |
3 | %table
4 | %tr
5 | %th Organization
6 | %th Context
7 | %th Creator
8 | %th Text
9 | %th Date
10 | %th Requirement
11 | %th Result
12 | %th Session
13 | %th
14 | %th
15 | %th
16 |
17 | - @motions.each do |motion|
18 | %tr
19 | %td= motion.organization
20 | %td= motion.context
21 | %td= motion.creator
22 | %td= motion.text
23 | %td= motion.date
24 | %td= motion.requirement
25 | %td= motion.result
26 | %td= motion.session
27 | %td= link_to 'Show', motion
28 | %td= link_to 'Edit', edit_motion_path(motion)
29 | %td= link_to 'Destroy', motion, :method => :delete, :data => { :confirm => 'Are you sure?' }
30 |
31 | %br
32 |
33 | = link_to 'New Motion', new_motion_path
34 |
--------------------------------------------------------------------------------
/app/views/motions/new.html.haml:
--------------------------------------------------------------------------------
1 | %h1 New motion
2 |
3 | = render 'form'
4 |
5 | = link_to 'Back', motions_path
6 |
--------------------------------------------------------------------------------
/app/views/motions/show.html.haml:
--------------------------------------------------------------------------------
1 | %p#notice= notice
2 |
3 | %p
4 | %b Organization:
5 | = @motion.organization
6 | %p
7 | %b Context:
8 | = @motion.context
9 | %p
10 | %b Creator:
11 | = @motion.creator
12 | %p
13 | %b Text:
14 | = @motion.text
15 | %p
16 | %b Date:
17 | = @motion.date
18 | %p
19 | %b Requirement:
20 | = @motion.requirement
21 | %p
22 | %b Result:
23 | = @motion.result
24 | %p
25 | %b Session:
26 | = @motion.session
27 |
28 | = link_to 'Edit', edit_motion_path(@motion)
29 | \|
30 | = link_to 'Back', motions_path
31 |
--------------------------------------------------------------------------------
/app/views/vote_events/_form.html.haml:
--------------------------------------------------------------------------------
1 | = form_for @vote_event do |f|
2 | - if @vote_event.errors.any?
3 | #error_explanation
4 | %h2= "#{pluralize(@vote_event.errors.count, "error")} prohibited this vote_event from being saved:"
5 | %ul
6 | - @vote_event.errors.full_messages.each do |msg|
7 | %li= msg
8 |
9 | .field
10 | = f.label :start_date
11 | = f.datetime_select :start_date
12 | .field
13 | = f.label :end_date
14 | = f.datetime_select :end_date
15 | .actions
16 | = f.submit 'Save'
17 |
--------------------------------------------------------------------------------
/app/views/vote_events/edit.html.haml:
--------------------------------------------------------------------------------
1 | %h1 Editing vote_event
2 |
3 | = render 'form'
4 |
5 | = link_to 'Show', @vote_event
6 | \|
7 | = link_to 'Back', vote_events_path
8 |
--------------------------------------------------------------------------------
/app/views/vote_events/index.html.haml:
--------------------------------------------------------------------------------
1 | %h1 Listing vote_events
2 |
3 | %table
4 | %tr
5 | %th Startdate
6 | %th Enddate
7 | %th
8 | %th
9 | %th
10 |
11 | - @vote_events.each do |vote_event|
12 | %tr
13 | %td= vote_event.start_date
14 | %td= vote_event.end_date
15 | %td= link_to 'Show', vote_event
16 | %td= link_to 'Edit', edit_vote_event_path(vote_event)
17 | %td= link_to 'Destroy', vote_event, :method => :delete, :data => { :confirm => 'Are you sure?' }
18 |
19 | %br
20 |
21 | = link_to 'New Vote event', new_vote_event_path
22 |
--------------------------------------------------------------------------------
/app/views/vote_events/new.html.haml:
--------------------------------------------------------------------------------
1 | %h1 New vote_event
2 |
3 | = render 'form'
4 |
5 | = link_to 'Back', vote_events_path
6 |
--------------------------------------------------------------------------------
/app/views/vote_events/show.html.haml:
--------------------------------------------------------------------------------
1 | %p#notice= notice
2 |
3 | %p
4 | %b Startdate:
5 | = @vote_event.start_date
6 | %p
7 | %b Enddate:
8 | = @vote_event.end_date
9 |
10 | = link_to 'Edit', edit_vote_event_path(@vote_event)
11 | \|
12 | = link_to 'Back', vote_events_path
13 |
--------------------------------------------------------------------------------
/app/views/votes/_form.html.haml:
--------------------------------------------------------------------------------
1 | = form_for @vote do |f|
2 | - if @vote.errors.any?
3 | #error_explanation
4 | %h2= "#{pluralize(@vote.errors.count, "error")} prohibited this vote from being saved:"
5 | %ul
6 | - @vote.errors.full_messages.each do |msg|
7 | %li= msg
8 |
9 | .field
10 | = f.label :voter_id
11 | = f.text_field :voter_id
12 | .field
13 | = f.label :option
14 | = f.text_field :option
15 | .actions
16 | = f.submit 'Save'
17 |
--------------------------------------------------------------------------------
/app/views/votes/edit.html.haml:
--------------------------------------------------------------------------------
1 | %h1 Editing vote
2 |
3 | = render 'form'
4 |
5 | = link_to 'Show', @vote
6 | \|
7 | = link_to 'Back', votes_path
8 |
--------------------------------------------------------------------------------
/app/views/votes/index.html.haml:
--------------------------------------------------------------------------------
1 | %h1 Listing votes
2 |
3 | %table
4 | %tr
5 | %th Voter
6 | %th Option
7 | %th
8 | %th
9 | %th
10 |
11 | - @votes.each do |vote|
12 | %tr
13 | %td= vote.voter_id
14 | %td= vote.option
15 | %td= link_to 'Show', vote
16 | %td= link_to 'Edit', edit_vote_path(vote)
17 | %td= link_to 'Destroy', vote, :method => :delete, :data => { :confirm => 'Are you sure?' }
18 |
19 | %br
20 |
21 | = link_to 'New Vote', new_vote_path
22 |
--------------------------------------------------------------------------------
/app/views/votes/new.html.haml:
--------------------------------------------------------------------------------
1 | %h1 New vote
2 |
3 | = render 'form'
4 |
5 | = link_to 'Back', votes_path
6 |
--------------------------------------------------------------------------------
/app/views/votes/show.html.haml:
--------------------------------------------------------------------------------
1 | %p#notice= notice
2 |
3 | %p
4 | %b Voter:
5 | = @vote.voter_id
6 | %p
7 | %b Option:
8 | = @vote.option
9 |
10 | = link_to 'Edit', edit_vote_path(@vote)
11 | \|
12 | = link_to 'Back', votes_path
13 |
--------------------------------------------------------------------------------
/config.ru.example:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run BillIt::Application
5 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | # Pick the frameworks you want:
4 | # require "active_record/railtie"
5 | require "action_controller/railtie"
6 | require "action_mailer/railtie"
7 | require "active_resource/railtie"
8 | require "sprockets/railtie"
9 | require "rails/test_unit/railtie"
10 |
11 | if defined?(Bundler)
12 | # If you precompile assets before deploying to production, use this line
13 | Bundler.require(*Rails.groups(:assets => %w(development test)))
14 | # If you want your assets lazily compiled in production, use this line
15 | # Bundler.require(:default, :assets, Rails.env)
16 | end
17 |
18 | # Load application ENV vars and merge with existing ENV vars. Loaded here so can use values in initializers.
19 | ENV.update YAML.load_file('config/hateoas.yml')[Rails.env] rescue {}
20 |
21 |
22 | module BillIt
23 | class Application < Rails::Application
24 | # Settings in config/environments/* take precedence over those specified here.
25 | # Application configuration should go into files in config/initializers
26 | # -- all .rb files in that directory are automatically loaded.
27 |
28 | # Custom directories with classes and modules you want to be autoloadable.
29 | # config.autoload_paths += %W(#{config.root}/extras)
30 | config.autoload_paths += %W(#{Rails.root}/app/models/billit)
31 |
32 | # Only load the plugins named here, in the order given (default is alphabetical).
33 | # :all can be used as a placeholder for all plugins not explicitly named.
34 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
35 |
36 | # Activate observers that should always be running.
37 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
38 |
39 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
40 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
41 | # config.time_zone = 'Central Time (US & Canada)'
42 |
43 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
44 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
45 | # config.i18n.default_locale = :de
46 |
47 | # Configure the default encoding used in templates for Ruby 1.9.
48 | config.encoding = "utf-8"
49 |
50 | # Configure sensitive parameters which will be filtered from the log file.
51 | config.filter_parameters += [:password]
52 |
53 | # Enable escaping HTML in JSON.
54 | config.active_support.escape_html_entities_in_json = true
55 |
56 | # Use SQL instead of Active Record's schema dumper when creating the database.
57 | # This is necessary if your schema can't be completely dumped by the schema dumper,
58 | # like if you have constraints or database-specific column types
59 | # config.active_record.schema_format = :sql
60 |
61 | # Enforce whitelist mode for mass assignment.
62 | # This will create an empty whitelist of attributes available for mass-assignment for all models
63 | # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
64 | # parameters by using an attr_accessible or attr_protected declaration.
65 | # config.active_record.whitelist_attributes = true
66 |
67 | # Enable the asset pipeline
68 | config.assets.enabled = true
69 |
70 | # Version of your assets, change this if you want to expire all your assets
71 | config.assets.version = '1.0'
72 |
73 | config.generators do |g|
74 | g.orm :mongoid
75 | g.template_engine :haml
76 | g.test_framework :rspec,
77 | :fixtures => true,
78 | :view_specs => false,
79 | :helper_specs => false,
80 | :routing_specs => false,
81 | :controller_specs => true,
82 | :request_specs => true
83 | g.fixture_replacement :factory_girl, :dir => "spec/factories"
84 | g.integration_tool nil
85 | g.performance_tool nil
86 | end
87 |
88 | # Application name
89 | config.application_name = "Bill-it"
90 | end
91 | end
92 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 |
3 | # Set up gems listed in the Gemfile.
4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5 |
6 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
7 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the rails application
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the rails application
5 | BillIt::Application.initialize!
6 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | BillIt::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Log error messages when you accidentally call methods on nil.
10 | config.whiny_nils = true
11 |
12 | # Show full error reports and disable caching
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger
20 | config.active_support.deprecation = :log
21 |
22 | # Only use best-standards-support built into browsers
23 | config.action_dispatch.best_standards_support = :builtin
24 |
25 |
26 | # Do not compress assets
27 | config.assets.compress = false
28 |
29 | # Expands the lines which load the assets
30 | config.assets.debug = true
31 |
32 | #Representers
33 | config.representer.default_url_options = {:host => ENV['root_url']}
34 |
35 | #ActiveAdmin
36 | config.action_mailer.default_url_options = { host: 'localhost:3000' }
37 |
38 | # Limit log disk space
39 | config.logger = Logger.new("log/#{Rails.env}.log", 1, ENV['log_size_limit'])
40 | end
41 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | BillIt::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # Code is not reloaded between requests
5 | config.cache_classes = true
6 |
7 | # Full error reports are disabled and caching is turned on
8 | config.consider_all_requests_local = false
9 | config.action_controller.perform_caching = true
10 |
11 | # Disable Rails's static asset server (Apache or nginx will already do this)
12 | config.serve_static_assets = false
13 |
14 | # Compress JavaScripts and CSS
15 | config.assets.compress = true
16 |
17 | # Don't fallback to assets pipeline if a precompiled asset is missed
18 | config.assets.compile = true
19 |
20 | # Generate digests for assets URLs
21 | config.assets.digest = true
22 |
23 | # Defaults to nil and saved in location specified by config.assets.prefix
24 | # config.assets.manifest = YOUR_PATH
25 |
26 | # Specifies the header that your server uses for sending files
27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29 |
30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31 | # config.force_ssl = true
32 |
33 | # See everything in the log (default is :info)
34 | config.log_level = :error
35 |
36 | # Prepend all log lines with the following tags
37 | # config.log_tags = [ :subdomain, :uuid ]
38 |
39 | # Use a different logger for distributed setups
40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41 |
42 | # Use a different cache store in production
43 | # config.cache_store = :mem_cache_store
44 |
45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server
46 | # config.action_controller.asset_host = "http://assets.example.com"
47 |
48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49 | # config.assets.precompile += %w( search.js )
50 |
51 | # Disable delivery errors, bad email addresses will be ignored
52 | # config.action_mailer.raise_delivery_errors = false
53 |
54 | # Enable threaded mode
55 | # config.threadsafe!
56 |
57 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58 | # the I18n.default_locale when a translation can not be found)
59 | config.i18n.fallbacks = true
60 |
61 | # Send deprecation notices to registered listeners
62 | config.active_support.deprecation = :notify
63 |
64 | # Representers
65 | config.representer.default_url_options = {:host => ENV['root_url']}
66 |
67 | # Limit log disk space
68 | config.logger = Logger.new("log/#{Rails.env}.log", 1, ENV['log_size_limit'])
69 | end
70 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | BillIt::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Configure static asset server for tests with Cache-Control for performance
11 | config.serve_static_assets = true
12 | config.static_cache_control = "public, max-age=3600"
13 |
14 | # Log error messages when you accidentally call methods on nil
15 | config.whiny_nils = true
16 |
17 | # Show full error reports and disable caching
18 | config.consider_all_requests_local = true
19 | config.action_controller.perform_caching = false
20 |
21 | # Raise exceptions instead of rendering exception templates
22 | config.action_dispatch.show_exceptions = false
23 |
24 | # Disable request forgery protection in test environment
25 | config.action_controller.allow_forgery_protection = false
26 |
27 | # Tell Action Mailer not to deliver emails to the real world.
28 | # The :test delivery method accumulates sent emails in the
29 | # ActionMailer::Base.deliveries array.
30 | config.action_mailer.delivery_method = :test
31 |
32 |
33 | # Print deprecation notices to the stderr
34 | config.active_support.deprecation = :stderr
35 |
36 | #Representers
37 | config.representer.default_url_options = {:host => ENV['root_url']}
38 | end
39 |
--------------------------------------------------------------------------------
/config/hateoas.yml.example:
--------------------------------------------------------------------------------
1 | production:
2 | root_url: "production.site.org"
3 | development:
4 | root_url: "development.site.org"
5 | test:
6 | root_url: "test.site.org"
--------------------------------------------------------------------------------
/config/holidays.yml:
--------------------------------------------------------------------------------
1 | 2014:
2 | Año_Nuevo: 2014/01/01
3 | Viernes_Santo: 2014/04/18
4 | Sábado_Santo: 2014/04/19
5 | Día_Nacional_del_Trabajo: 2014/05/01
6 | Día_de_las_Glorias_Navales: 2014/05/21
7 | San_Pedro_y_San_Pablo: 2014/06/29
8 | Día_de_la_Virgen_del_Carmen: 2014/08/15
9 | Independencia_Nacional: 2014/09/18
10 | Día_de_las_Glorias_del_Ejército: 2014/09/19
11 | Encuentro_de_Dos_Mundos: 2014/10/12
12 | Día_de_las_Iglesias_Evangélicas_y_Protestantes: 2014/10/31
13 | Día_de_Todos_los_Santos: 2014/11/01
14 | Inmaculada_Concepción: 2014/12/08
15 | Navidad: 2014/12/25
16 | 2015:
17 | Año_Nuevo: 2015/01/01
18 | Viernes_Santo: 2015/04/03
19 | Sábado_Santo: 2015/04/04
20 | Día_Nacional_del_Trabajo: 2015/05/01
21 | Día_de_las_Glorias_Navales: 2015/05/21
22 | San_Pedro_y_San_Pablo: 2015/06/29
23 | Día_de_la_Virgen_del_Carmen: 2015/08/15
24 | Independencia_Nacional: 2015/09/18
25 | Día_de_las_Glorias_del_Ejército: 2015/09/19
26 | Encuentro_de_Dos_Mundos: 2015/10/12
27 | Día_de_las_Iglesias_Evangélicas_y_Protestantes: 2015/10/31
28 | Día_de_Todos_los_Santos: 2015/11/01
29 | Inmaculada_Concepción: 2015/12/08
30 | Navidad: 2015/12/25
--------------------------------------------------------------------------------
/config/initializers/active_admin.rb:
--------------------------------------------------------------------------------
1 | ActiveAdmin.setup do |config|
2 |
3 | # == Site Title
4 | #
5 | # Set the title that is displayed on the main layout
6 | # for each of the active admin pages.
7 | #
8 | config.site_title = "Bill It"
9 |
10 | # Set the link url for the title. For example, to take
11 | # users to your main site. Defaults to no link.
12 | #
13 | # config.site_title_link = "/"
14 |
15 | # Set an optional image to be displayed for the header
16 | # instead of a string (overrides :site_title)
17 | #
18 | # Note: Recommended image height is 21px to properly fit in the header
19 | #
20 | # config.site_title_image = "/images/logo.png"
21 |
22 | # == Default Namespace
23 | #
24 | # Set the default namespace each administration resource
25 | # will be added to.
26 | #
27 | # eg:
28 | # config.default_namespace = :hello_world
29 | #
30 | # This will create resources in the HelloWorld module and
31 | # will namespace routes to /hello_world/*
32 | #
33 | # To set no namespace by default, use:
34 | # config.default_namespace = false
35 | #
36 | # Default:
37 | # config.default_namespace = :admin
38 | #
39 | # You can customize the settings for each namespace by using
40 | # a namespace block. For example, to change the site title
41 | # within a namespace:
42 | #
43 | # config.namespace :admin do |admin|
44 | # admin.site_title = "Custom Admin Title"
45 | # end
46 | #
47 | # This will ONLY change the title for the admin section. Other
48 | # namespaces will continue to use the main "site_title" configuration.
49 |
50 | # == User Authentication
51 | #
52 | # Active Admin will automatically call an authentication
53 | # method in a before filter of all controller actions to
54 | # ensure that there is a currently logged in admin user.
55 | #
56 | # This setting changes the method which Active Admin calls
57 | # within the controller.
58 | config.authentication_method = :authenticate_admin_user!
59 |
60 | # == User Authorization
61 | #
62 | # Active Admin will automatically call an authorization
63 | # method in a before filter of all controller actions to
64 | # ensure that there is a user with proper rights. You can use
65 | # CanCanAdapter or make your own. Please refer to documentation.
66 | # config.authorization_adapter = ActiveAdmin::CanCanAdapter
67 |
68 | # You can customize your CanCan Ability class name here.
69 | # config.cancan_ability_class = "Ability"
70 |
71 | # You can specify a method to be called on unauthorized access.
72 | # This is necessary in order to prevent a redirect loop which happens
73 | # because, by default, user gets redirected to Dashboard. If user
74 | # doesn't have access to Dashboard, he'll end up in a redirect loop.
75 | # Method provided here should be defined in application_controller.rb.
76 | # config.on_unauthorized_access = :access_denied
77 |
78 | # == Current User
79 | #
80 | # Active Admin will associate actions with the current
81 | # user performing them.
82 | #
83 | # This setting changes the method which Active Admin calls
84 | # to return the currently logged in user.
85 | config.current_user_method = :current_admin_user
86 |
87 |
88 | # == Logging Out
89 | #
90 | # Active Admin displays a logout link on each screen. These
91 | # settings configure the location and method used for the link.
92 | #
93 | # This setting changes the path where the link points to. If it's
94 | # a string, the strings is used as the path. If it's a Symbol, we
95 | # will call the method to return the path.
96 | #
97 | # Default:
98 | config.logout_link_path = :destroy_admin_user_session_path
99 |
100 | # This setting changes the http method used when rendering the
101 | # link. For example :get, :delete, :put, etc..
102 | #
103 | # Default:
104 | # config.logout_link_method = :get
105 |
106 |
107 | # == Root
108 | #
109 | # Set the action to call for the root path. You can set different
110 | # roots for each namespace.
111 | #
112 | # Default:
113 | # config.root_to = 'dashboard#index'
114 |
115 |
116 | # == Admin Comments
117 | #
118 | # This allows your users to comment on any resource registered with Active Admin.
119 | #
120 | # You can completely disable comments:
121 | # config.allow_comments = false
122 | #
123 | # You can disable the menu item for the comments index page:
124 | # config.show_comments_in_menu = false
125 | #
126 | # You can change the name under which comments are registered:
127 | # config.comments_registration_name = 'AdminComment'
128 |
129 |
130 | # == Batch Actions
131 | #
132 | # Enable and disable Batch Actions
133 | #
134 | config.batch_actions = true
135 |
136 |
137 | # == Controller Filters
138 | #
139 | # You can add before, after and around filters to all of your
140 | # Active Admin resources and pages from here.
141 | #
142 | # config.before_filter :do_something_awesome
143 |
144 |
145 | # == Setting a Favicon
146 | #
147 | # config.favicon = '/assets/favicon.ico'
148 |
149 |
150 | # == Register Stylesheets & Javascripts
151 | #
152 | # We recommend using the built in Active Admin layout and loading
153 | # up your own stylesheets / javascripts to customize the look
154 | # and feel.
155 | #
156 | # To load a stylesheet:
157 | # config.register_stylesheet 'my_stylesheet.css'
158 | #
159 | # You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
160 | # config.register_stylesheet 'my_print_stylesheet.css', :media => :print
161 | #
162 | # To load a javascript file:
163 | # config.register_javascript 'my_javascript.js'
164 |
165 |
166 | # == CSV options
167 | #
168 | # Set the CSV builder separator
169 | # config.csv_options = { :col_sep => ';' }
170 | #
171 | # Force the use of quotes
172 | # config.csv_options = { :force_quotes => true }
173 |
174 |
175 | # == Menu System
176 | #
177 | # You can add a navigation menu to be used in your application, or configure a provided menu
178 | #
179 | # To change the default utility navigation to show a link to your website & a logout btn
180 | #
181 | # config.namespace :admin do |admin|
182 | # admin.build_menu :utility_navigation do |menu|
183 | # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
184 | # admin.add_logout_button_to_menu menu
185 | # end
186 | # end
187 | #
188 | # If you wanted to add a static menu item to the default menu provided:
189 | #
190 | # config.namespace :admin do |admin|
191 | # admin.build_menu :default do |menu|
192 | # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
193 | # end
194 | # end
195 |
196 |
197 | # == Download Links
198 | #
199 | # You can disable download links on resource listing pages,
200 | # or customize the formats shown per namespace/globally
201 | #
202 | # To disable/customize for the :admin namespace:
203 | #
204 | # config.namespace :admin do |admin|
205 | #
206 | # # Disable the links entirely
207 | # admin.download_links = false
208 | #
209 | # # Only show XML & PDF options
210 | # admin.download_links = [:xml, :pdf]
211 | #
212 | # end
213 |
214 |
215 | # == Pagination
216 | #
217 | # Pagination is enabled by default for all resources.
218 | # You can control the default per page count for all resources here.
219 | #
220 | # config.default_per_page = 30
221 |
222 |
223 | # == Filters
224 | #
225 | # By default the index screen includes a “Filters” sidebar on the right
226 | # hand side with a filter for each attribute of the registered model.
227 | # You can enable or disable them for all resources here.
228 | #
229 | # config.filters = true
230 |
231 | end
232 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/config/initializers/holidays.rb:
--------------------------------------------------------------------------------
1 | all_holidays = YAML.load_file("#{Rails.root}/config/holidays.yml")
2 | all_holidays.values.each do |year|
3 | year.values.each do |holiday|
4 | BusinessTime::Config.holidays << holiday.to_date
5 | end
6 | end
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format
4 | # (all these examples are active by default):
5 | # ActiveSupport::Inflector.inflections do |inflect|
6 | # inflect.plural /^(ox)$/i, '\1en'
7 | # inflect.singular /^(ox)en/i, '\1'
8 | # inflect.irregular 'person', 'people'
9 | # inflect.uncountable %w( fish sheep )
10 | # end
11 | #
12 | # These inflection rules are supported but not enabled by default:
13 | # ActiveSupport::Inflector.inflections do |inflect|
14 | # inflect.acronym 'RESTful'
15 | # end
16 |
--------------------------------------------------------------------------------
/config/initializers/load_hateoas.rb:
--------------------------------------------------------------------------------
1 | HATEOAS = YAML.load_file("#{Rails.root}/config/hateoas.yml")[Rails.env]
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 | # Mime::Type.register_alias "text/html", :iphone
6 |
--------------------------------------------------------------------------------
/config/initializers/secret_token.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 | # Make sure the secret is at least 30 characters and all random,
6 | # no regular words or you'll be exposed to dictionary attacks.
7 | BillIt::Application.config.secret_token = '75cc973db60d3e07beaa1630c4cb37ded228e5bb71853be068a573b1a2ee385379111f9b12847b285a7e2c2b2f918b2902f4edb04046319cf41148a642fa53d3'
8 |
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | BillIt::Application.config.session_store :cookie_store, key: '_bill-it_session'
4 |
5 | # Use the database for sessions instead of the cookie-based default,
6 | # which shouldn't be used to store highly confidential information
7 | # (create the session table with "rails generate session_migration")
8 | # BillIt::Application.config.session_store :active_record_store
9 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 | #
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json]
9 | end
10 |
11 |
--------------------------------------------------------------------------------
/config/locales/devise.en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2 |
3 | en:
4 | devise:
5 | confirmations:
6 | confirmed: "Your account was successfully confirmed."
7 | send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
9 | failure:
10 | already_authenticated: "You are already signed in."
11 | inactive: "Your account is not activated yet."
12 | invalid: "Invalid email or password."
13 | locked: "Your account is locked."
14 | last_attempt: "You have one more attempt before your account will be locked."
15 | not_found_in_database: "Invalid email or password."
16 | timeout: "Your session expired. Please sign in again to continue."
17 | unauthenticated: "You need to sign in or sign up before continuing."
18 | unconfirmed: "You have to confirm your account before continuing."
19 | mailer:
20 | confirmation_instructions:
21 | subject: "Confirmation instructions"
22 | reset_password_instructions:
23 | subject: "Reset password instructions"
24 | unlock_instructions:
25 | subject: "Unlock Instructions"
26 | omniauth_callbacks:
27 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28 | success: "Successfully authenticated from %{kind} account."
29 | passwords:
30 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33 | updated: "Your password was changed successfully. You are now signed in."
34 | updated_not_active: "Your password was changed successfully."
35 | registrations:
36 | destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon."
37 | signed_up: "Welcome! You have signed up successfully."
38 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account."
41 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
42 | updated: "You updated your account successfully."
43 | sessions:
44 | signed_in: "Signed in successfully."
45 | signed_out: "Signed out successfully."
46 | unlocks:
47 | send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes."
48 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
49 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
50 | errors:
51 | messages:
52 | already_confirmed: "was already confirmed, please try signing in"
53 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
54 | expired: "has expired, please request a new one"
55 | not_found: "not found"
56 | not_locked: "was not locked"
57 | not_saved:
58 | one: "1 error prohibited this %{resource} from being saved:"
59 | other: "%{count} errors prohibited this %{resource} from being saved:"
60 |
--------------------------------------------------------------------------------
/config/locales/transliterate_special.yml:
--------------------------------------------------------------------------------
1 | transliterate_special:
2 | i18n:
3 | transliterate:
4 | rule:
5 | ñ: "ñ"
6 | Ñ: "ñ"
--------------------------------------------------------------------------------
/config/log.yml.example:
--------------------------------------------------------------------------------
1 | production:
2 | log_size_limit: 5.megabytes
3 | development:
4 | log_size_limit: 5.megabytes
5 | test:
6 | log_size_limit: 5.megabytes
--------------------------------------------------------------------------------
/config/mongoid.yml.example:
--------------------------------------------------------------------------------
1 | development:
2 | # Configure available database sessions. (required)
3 | sessions:
4 | # Defines the default session. (required)
5 | default:
6 | # Defines the name of the default database that Mongoid can connect to.
7 | # (required).
8 | database: bill_it_development
9 | # Provides the hosts the default session can connect to. Must be an array
10 | # of host:port pairs. (required)
11 | hosts:
12 | - localhost:27017
13 | options:
14 | # Change whether the session persists in safe mode by default.
15 | # (default: false)
16 | # safe: false
17 |
18 | # Change the default consistency model to :eventual or :strong.
19 | # :eventual will send reads to secondaries, :strong sends everything
20 | # to master. (default: :eventual)
21 | # consistency: :eventual
22 |
23 | # How many times Moped should attempt to retry an operation after
24 | # failure. (default: 30)
25 | # max_retries: 30
26 |
27 | # The time in seconds that Moped should wait before retrying an
28 | # operation on failure. (default: 1)
29 | # retry_interval: 1
30 | # Configure Mongoid specific options. (optional)
31 | options:
32 | raise_not_found_error: false
33 | # Configuration for whether or not to allow access to fields that do
34 | # not have a field definition on the model. (default: true)
35 | # allow_dynamic_fields: true
36 |
37 | # Enable the identity map, needed for eager loading. (default: false)
38 | # identity_map_enabled: false
39 |
40 | # Includes the root model name in json serialization. (default: false)
41 | # include_root_in_json: false
42 |
43 | # Include the _type field in serializaion. (default: false)
44 | # include_type_for_serialization: false
45 |
46 | # Preload all models in development, needed when models use
47 | # inheritance. (default: false)
48 | # preload_models: false
49 |
50 | # Protect id and type from mass assignment. (default: true)
51 | # protect_sensitive_fields: true
52 |
53 | # Raise an error when performing a #find and the document is not found.
54 | # (default: true)
55 | # raise_not_found_error: true
56 |
57 | # Raise an error when defining a scope with the same name as an
58 | # existing method. (default: false)
59 | # scope_overwrite_exception: false
60 |
61 | # Skip the database version check, used when connecting to a db without
62 | # admin access. (default: false)
63 | # skip_version_check: false
64 |
65 | # User Active Support's time zone in conversions. (default: true)
66 | # use_activesupport_time_zone: true
67 |
68 | # Ensure all times are UTC in the app side. (default: false)
69 | # use_utc: false
70 | test:
71 | sessions:
72 | default:
73 | database: bill_it_test
74 | hosts:
75 | - localhost:27017
76 | options:
77 | consistency: :strong
78 | # In the test environment we lower the retries and retry interval to
79 | # low amounts for fast failures.
80 | max_retries: 1
81 | retry_interval: 0
82 | options:
83 | raise_not_found_error: false
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | BillIt::Application.routes.draw do
2 |
3 | resources :votes
4 |
5 |
6 | resources :counts
7 |
8 |
9 | resources :vote_events
10 |
11 |
12 | resources :motions
13 |
14 |
15 | devise_for :admin_users, ActiveAdmin::Devise.config
16 | ActiveAdmin.routes(self)
17 |
18 | root :to => "bills#index"
19 |
20 | resources :paperworks do
21 | get 'search', on: :collection
22 | end
23 |
24 | resources :bills do
25 | get 'feed', on: :member
26 | get 'search', on: :collection
27 | get 'last_update', on: :collection
28 | end
29 | end
--------------------------------------------------------------------------------
/config/schedule.rb.example:
--------------------------------------------------------------------------------
1 | # Use this file to easily define all of your cron jobs.
2 | #
3 | # It's helpful, but not entirely necessary to understand cron before proceeding.
4 | # http://en.wikipedia.org/wiki/Cron
5 |
6 | set :output, 'log/cron.log'
7 |
8 | every :day, :at => '12:00am' do
9 | runner 'Bill.update_priority'
10 | end
11 |
12 | # Learn more: http://github.com/javan/whenever
13 |
--------------------------------------------------------------------------------
/config/sunspot.yml.example:
--------------------------------------------------------------------------------
1 | production:
2 | solr:
3 | hostname: localhost
4 | port: 8983
5 | log_level: WARNING
6 | # read_timeout: 2
7 | # open_timeout: 0.5
8 |
9 | development:
10 | solr:
11 | hostname: localhost
12 | port: 8983
13 | log_level: INFO
14 |
15 | test:
16 | solr:
17 | hostname: localhost
18 | port: 8983
19 | log_level: WARNING
20 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7 | # Mayor.create(name: 'Emanuel', city: cities.first)
8 |
--------------------------------------------------------------------------------
/doc/README_FOR_APP:
--------------------------------------------------------------------------------
1 | Use this README file to introduce your application and point to useful places in the API for learning more.
2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
3 |
--------------------------------------------------------------------------------
/lib/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/lib/assets/.gitkeep
--------------------------------------------------------------------------------
/lib/tasks/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/lib/tasks/.gitkeep
--------------------------------------------------------------------------------
/lib/tasks/sunspot_mongoid.rake:
--------------------------------------------------------------------------------
1 | # auto load rails tasks
2 | require 'sunspot/rails/tasks'
3 |
4 | # hack to remove 'sunspot:reindex' task and add our own
5 | Rake::TaskManager.class_eval do
6 | def remove_task(task_name)
7 | @tasks.delete(task_name.to_s)
8 | end
9 | end
10 |
11 | Rake.application.remove_task('sunspot:reindex')
12 |
13 | # override the tasks that depends on active record
14 | namespace :sunspot do
15 |
16 | desc "Reindex all solr models that are located in your application's models directory. (Batch size ignored)"
17 | # This task depends on the standard Rails file naming \
18 | # conventions, in that the file name matches the defined class name. \
19 | # By default the indexing system works in batches of 50 records, you can \
20 | # set your own value for this by using the batch_size argument. You can \
21 | # also optionally define a list of models to separated by a forward slash '/'
22 | #
23 | # $ rake sunspot:reindex # reindex all models
24 | # $ rake sunspot:reindex[1000] # reindex in batches of 1000
25 | # $ rake sunspot:reindex[false] # reindex without batching
26 | # $ rake sunspot:reindex[,Post] # reindex only the Post model
27 | # $ rake sunspot:reindex[1000,Post] # reindex only the Post model in
28 | # # batchs of 1000
29 | # $ rake sunspot:reindex[,Post+Author] # reindex Post and Author model
30 | task :reindex, [:batch_size, :models] => [:environment] do |t, args|
31 | unless args[:models]
32 | all_files = Dir.glob(Rails.root.join('app', 'models', '*.rb'))
33 | all_models = all_files.map { |path| File.basename(path, '.rb').camelize.constantize }
34 | sunspot_models = all_models.select { |m| m.respond_to?(:searchable?) and m.searchable? }
35 | else
36 | sunspot_models = args[:models].split('+').map{|m| m.constantize}
37 | end
38 | sunspot_models.each do |model|
39 | puts "Re-indexing #{model.name}"
40 | bar = ProgressBar.new(model.count)
41 | Sunspot.remove_all(model)
42 | model.each do |element|
43 | Sunspot.index!(element)
44 | bar.increment!
45 | end
46 | end
47 | end
48 | end
--------------------------------------------------------------------------------
/log/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
17 |
18 |
19 |
20 |
21 |
22 |
The page you were looking for doesn't exist.
23 |
You may have mistyped the address or the page may have moved.
24 |
25 |
26 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/public/favicon.ico
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-Agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/script/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 |
4 | APP_PATH = File.expand_path('../../config/application', __FILE__)
5 | require File.expand_path('../../config/boot', __FILE__)
6 | require 'rails/commands'
7 |
--------------------------------------------------------------------------------
/solr/conf/admin-extra.html:
--------------------------------------------------------------------------------
1 |
17 |
18 |
32 |
--------------------------------------------------------------------------------
/solr/conf/elevate.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/solr/conf/mapping-ISOLatin1Accent.txt:
--------------------------------------------------------------------------------
1 | # The ASF licenses this file to You under the Apache License, Version 2.0
2 | # (the "License"); you may not use this file except in compliance with
3 | # the License. You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | # Syntax:
14 | # "source" => "target"
15 | # "source".length() > 0 (source cannot be empty.)
16 | # "target".length() >= 0 (target can be empty.)
17 |
18 | # example:
19 | # "À" => "A"
20 | # "\u00C0" => "A"
21 | # "\u00C0" => "\u0041"
22 | # "ß" => "ss"
23 | # "\t" => " "
24 | # "\n" => ""
25 |
26 | # À => A
27 | "\u00C0" => "A"
28 |
29 | # Á => A
30 | "\u00C1" => "A"
31 |
32 | # Â => A
33 | "\u00C2" => "A"
34 |
35 | # Ã => A
36 | "\u00C3" => "A"
37 |
38 | # Ä => A
39 | "\u00C4" => "A"
40 |
41 | # Å => A
42 | "\u00C5" => "A"
43 |
44 | # Æ => AE
45 | "\u00C6" => "AE"
46 |
47 | # Ç => C
48 | "\u00C7" => "C"
49 |
50 | # È => E
51 | "\u00C8" => "E"
52 |
53 | # É => E
54 | "\u00C9" => "E"
55 |
56 | # Ê => E
57 | "\u00CA" => "E"
58 |
59 | # Ë => E
60 | "\u00CB" => "E"
61 |
62 | # Ì => I
63 | "\u00CC" => "I"
64 |
65 | # Í => I
66 | "\u00CD" => "I"
67 |
68 | # Î => I
69 | "\u00CE" => "I"
70 |
71 | # Ï => I
72 | "\u00CF" => "I"
73 |
74 | # IJ => IJ
75 | "\u0132" => "IJ"
76 |
77 | # Ð => D
78 | "\u00D0" => "D"
79 |
80 | # Ñ => N
81 | "\u00D1" => "N"
82 |
83 | # Ò => O
84 | "\u00D2" => "O"
85 |
86 | # Ó => O
87 | "\u00D3" => "O"
88 |
89 | # Ô => O
90 | "\u00D4" => "O"
91 |
92 | # Õ => O
93 | "\u00D5" => "O"
94 |
95 | # Ö => O
96 | "\u00D6" => "O"
97 |
98 | # Ø => O
99 | "\u00D8" => "O"
100 |
101 | # Œ => OE
102 | "\u0152" => "OE"
103 |
104 | # Þ
105 | "\u00DE" => "TH"
106 |
107 | # Ù => U
108 | "\u00D9" => "U"
109 |
110 | # Ú => U
111 | "\u00DA" => "U"
112 |
113 | # Û => U
114 | "\u00DB" => "U"
115 |
116 | # Ü => U
117 | "\u00DC" => "U"
118 |
119 | # Ý => Y
120 | "\u00DD" => "Y"
121 |
122 | # Ÿ => Y
123 | "\u0178" => "Y"
124 |
125 | # à => a
126 | "\u00E0" => "a"
127 |
128 | # á => a
129 | "\u00E1" => "a"
130 |
131 | # â => a
132 | "\u00E2" => "a"
133 |
134 | # ã => a
135 | "\u00E3" => "a"
136 |
137 | # ä => a
138 | "\u00E4" => "a"
139 |
140 | # å => a
141 | "\u00E5" => "a"
142 |
143 | # æ => ae
144 | "\u00E6" => "ae"
145 |
146 | # ç => c
147 | "\u00E7" => "c"
148 |
149 | # è => e
150 | "\u00E8" => "e"
151 |
152 | # é => e
153 | "\u00E9" => "e"
154 |
155 | # ê => e
156 | "\u00EA" => "e"
157 |
158 | # ë => e
159 | "\u00EB" => "e"
160 |
161 | # ì => i
162 | "\u00EC" => "i"
163 |
164 | # í => i
165 | "\u00ED" => "i"
166 |
167 | # î => i
168 | "\u00EE" => "i"
169 |
170 | # ï => i
171 | "\u00EF" => "i"
172 |
173 | # ij => ij
174 | "\u0133" => "ij"
175 |
176 | # ð => d
177 | "\u00F0" => "d"
178 |
179 | # ñ => n
180 | "\u00F1" => "n"
181 |
182 | # ò => o
183 | "\u00F2" => "o"
184 |
185 | # ó => o
186 | "\u00F3" => "o"
187 |
188 | # ô => o
189 | "\u00F4" => "o"
190 |
191 | # õ => o
192 | "\u00F5" => "o"
193 |
194 | # ö => o
195 | "\u00F6" => "o"
196 |
197 | # ø => o
198 | "\u00F8" => "o"
199 |
200 | # œ => oe
201 | "\u0153" => "oe"
202 |
203 | # ß => ss
204 | "\u00DF" => "ss"
205 |
206 | # þ => th
207 | "\u00FE" => "th"
208 |
209 | # ù => u
210 | "\u00F9" => "u"
211 |
212 | # ú => u
213 | "\u00FA" => "u"
214 |
215 | # û => u
216 | "\u00FB" => "u"
217 |
218 | # ü => u
219 | "\u00FC" => "u"
220 |
221 | # ý => y
222 | "\u00FD" => "y"
223 |
224 | # ÿ => y
225 | "\u00FF" => "y"
226 |
227 | # ff => ff
228 | "\uFB00" => "ff"
229 |
230 | # fi => fi
231 | "\uFB01" => "fi"
232 |
233 | # fl => fl
234 | "\uFB02" => "fl"
235 |
236 | # ffi => ffi
237 | "\uFB03" => "ffi"
238 |
239 | # ffl => ffl
240 | "\uFB04" => "ffl"
241 |
242 | # ſt => ft
243 | "\uFB05" => "ft"
244 |
245 | # st => st
246 | "\uFB06" => "st"
247 |
--------------------------------------------------------------------------------
/solr/conf/protwords.txt:
--------------------------------------------------------------------------------
1 | # The ASF licenses this file to You under the Apache License, Version 2.0
2 | # (the "License"); you may not use this file except in compliance with
3 | # the License. You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | #-----------------------------------------------------------------------
14 | # Use a protected word file to protect against the stemmer reducing two
15 | # unrelated words to the same base word.
16 |
17 | # Some non-words that normally won't be encountered,
18 | # just to test that they won't be stemmed.
19 | dontstems
20 | zwhacky
21 |
22 |
--------------------------------------------------------------------------------
/solr/conf/scripts.conf:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | user=
17 | solr_hostname=localhost
18 | solr_port=8983
19 | rsyncd_port=18983
20 | data_dir=
21 | webapp_name=solr
22 | master_host=
23 | master_data_dir=
24 | master_status_dir=
25 |
--------------------------------------------------------------------------------
/solr/conf/spellings.txt:
--------------------------------------------------------------------------------
1 | pizza
2 | history
--------------------------------------------------------------------------------
/solr/conf/stopwords.txt:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | #-----------------------------------------------------------------------
17 | # a couple of test stopwords to test that the words are really being
18 | # configured from this file:
19 | stopworda
20 | stopwordb
21 |
22 | #Standard english stop words taken from Lucene's StopAnalyzer
23 | a
24 | an
25 | and
26 | are
27 | as
28 | at
29 | be
30 | but
31 | by
32 | for
33 | if
34 | in
35 | into
36 | is
37 | it
38 | no
39 | not
40 | of
41 | on
42 | or
43 | s
44 | such
45 | t
46 | that
47 | the
48 | their
49 | then
50 | there
51 | these
52 | they
53 | this
54 | to
55 | was
56 | will
57 | with
58 |
59 |
--------------------------------------------------------------------------------
/solr/conf/synonyms.txt:
--------------------------------------------------------------------------------
1 | # The ASF licenses this file to You under the Apache License, Version 2.0
2 | # (the "License"); you may not use this file except in compliance with
3 | # the License. You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | #-----------------------------------------------------------------------
14 | #some test synonym mappings unlikely to appear in real input text
15 | aaa => aaaa
16 | bbb => bbbb1 bbbb2
17 | ccc => cccc1,cccc2
18 | a\=>a => b\=>b
19 | a\,a => b\,b
20 | fooaaa,baraaa,bazaaa
21 |
22 | # Some synonym groups specific to this example
23 | GB,gib,gigabyte,gigabytes
24 | MB,mib,megabyte,megabytes
25 | Television, Televisions, TV, TVs
26 | #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
27 | #after us won't split it into two words.
28 |
29 | # Synonym mappings can be used for spelling correction too
30 | pixima => pixma
31 |
32 |
--------------------------------------------------------------------------------
/solr/lib/apache-mime4j-core-0.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/apache-mime4j-core-0.7.jar
--------------------------------------------------------------------------------
/solr/lib/apache-mime4j-dom-0.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/apache-mime4j-dom-0.7.jar
--------------------------------------------------------------------------------
/solr/lib/apache-solr-cell-3.5-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/apache-solr-cell-3.5-SNAPSHOT.jar
--------------------------------------------------------------------------------
/solr/lib/asm-3.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/asm-3.1.jar
--------------------------------------------------------------------------------
/solr/lib/bcmail-jdk15-1.45.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/bcmail-jdk15-1.45.jar
--------------------------------------------------------------------------------
/solr/lib/bcprov-jdk15-1.45.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/bcprov-jdk15-1.45.jar
--------------------------------------------------------------------------------
/solr/lib/boilerpipe-1.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/boilerpipe-1.1.0.jar
--------------------------------------------------------------------------------
/solr/lib/commons-compress-1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/commons-compress-1.2.jar
--------------------------------------------------------------------------------
/solr/lib/dom4j-1.6.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/dom4j-1.6.1.jar
--------------------------------------------------------------------------------
/solr/lib/fontbox-1.6.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/fontbox-1.6.0.jar
--------------------------------------------------------------------------------
/solr/lib/icu4j-4_8_1_1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/icu4j-4_8_1_1.jar
--------------------------------------------------------------------------------
/solr/lib/jempbox-1.6.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/jempbox-1.6.0.jar
--------------------------------------------------------------------------------
/solr/lib/metadata-extractor-2.4.0-beta-1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/metadata-extractor-2.4.0-beta-1.jar
--------------------------------------------------------------------------------
/solr/lib/netcdf-4.2-min.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/netcdf-4.2-min.jar
--------------------------------------------------------------------------------
/solr/lib/pdfbox-1.6.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/pdfbox-1.6.0.jar
--------------------------------------------------------------------------------
/solr/lib/poi-3.8-beta4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/poi-3.8-beta4.jar
--------------------------------------------------------------------------------
/solr/lib/poi-ooxml-3.8-beta4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/poi-ooxml-3.8-beta4.jar
--------------------------------------------------------------------------------
/solr/lib/poi-ooxml-schemas-3.8-beta4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/poi-ooxml-schemas-3.8-beta4.jar
--------------------------------------------------------------------------------
/solr/lib/poi-scratchpad-3.8-beta4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/poi-scratchpad-3.8-beta4.jar
--------------------------------------------------------------------------------
/solr/lib/rome-0.9.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/rome-0.9.jar
--------------------------------------------------------------------------------
/solr/lib/tagsoup-1.2.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/tagsoup-1.2.1.jar
--------------------------------------------------------------------------------
/solr/lib/tika-core-0.10.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/tika-core-0.10.jar
--------------------------------------------------------------------------------
/solr/lib/tika-parsers-0.10.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/tika-parsers-0.10.jar
--------------------------------------------------------------------------------
/solr/lib/xercesImpl-2.8.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/xercesImpl-2.8.1.jar
--------------------------------------------------------------------------------
/solr/lib/xml-apis-1.0.b2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/xml-apis-1.0.b2.jar
--------------------------------------------------------------------------------
/solr/lib/xmlbeans-2.3.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/solr/lib/xmlbeans-2.3.0.jar
--------------------------------------------------------------------------------
/spec/controllers/counts_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | # This spec was generated by rspec-rails when you ran the scaffold generator.
4 | # It demonstrates how one might use RSpec to specify the controller code that
5 | # was generated by Rails when you ran the scaffold generator.
6 | #
7 | # It assumes that the implementation code is generated by the rails scaffold
8 | # generator. If you are using any extension libraries to generate different
9 | # controller code, this generated spec may or may not pass.
10 | #
11 | # It only uses APIs available in rails and/or rspec-rails. There are a number
12 | # of tools you can use to make these specs even more expressive, but we're
13 | # sticking to rails and rspec-rails APIs to keep things simple and stable.
14 | #
15 | # Compared to earlier versions of this generator, there is very limited use of
16 | # stubs and message expectations in this spec. Stubs are only used when there
17 | # is no simpler way to get a handle on the object needed for the example.
18 | # Message expectations are only used when there is no simpler way to specify
19 | # that an instance is receiving a specific message.
20 |
21 | describe CountsController, pending: "not clear what methods it should have" do
22 |
23 | # This should return the minimal set of attributes required to create a valid
24 | # Count. As you add validations to Count, be sure to
25 | # adjust the attributes here as well.
26 | let(:valid_attributes) { { "option" => "MyString" } }
27 |
28 | # This should return the minimal set of values that should be in the session
29 | # in order to pass any filters (e.g. authentication) defined in
30 | # CountsController. Be sure to keep this updated too.
31 | let(:valid_session) { {} }
32 |
33 | describe "GET index" do
34 | it "assigns all counts as @counts" do
35 | count = Count.create! valid_attributes
36 | get :index, {}, valid_session
37 | assigns(:counts).should eq([count])
38 | end
39 | end
40 |
41 | describe "GET show" do
42 | it "assigns the requested count as @count" do
43 | count = Count.create! valid_attributes
44 | get :show, {:id => count.to_param}, valid_session
45 | assigns(:count).should eq(count)
46 | end
47 | end
48 |
49 | describe "GET new" do
50 | it "assigns a new count as @count" do
51 | get :new, {}, valid_session
52 | assigns(:count).should be_a_new(Count)
53 | end
54 | end
55 |
56 | describe "GET edit" do
57 | it "assigns the requested count as @count" do
58 | count = Count.create! valid_attributes
59 | get :edit, {:id => count.to_param}, valid_session
60 | assigns(:count).should eq(count)
61 | end
62 | end
63 |
64 | describe "POST create" do
65 | describe "with valid params" do
66 | it "creates a new Count" do
67 | expect {
68 | post :create, {:count => valid_attributes}, valid_session
69 | }.to change(Count, :count).by(1)
70 | end
71 |
72 | it "assigns a newly created count as @count" do
73 | post :create, {:count => valid_attributes}, valid_session
74 | assigns(:count).should be_a(Count)
75 | assigns(:count).should be_persisted
76 | end
77 |
78 | it "redirects to the created count" do
79 | post :create, {:count => valid_attributes}, valid_session
80 | response.should redirect_to(Count.last)
81 | end
82 | end
83 |
84 | describe "with invalid params" do
85 | it "assigns a newly created but unsaved count as @count" do
86 | # Trigger the behavior that occurs when invalid params are submitted
87 | Count.any_instance.stub(:save).and_return(false)
88 | post :create, {:count => { "option" => "invalid value" }}, valid_session
89 | assigns(:count).should be_a_new(Count)
90 | end
91 |
92 | it "re-renders the 'new' template" do
93 | # Trigger the behavior that occurs when invalid params are submitted
94 | Count.any_instance.stub(:save).and_return(false)
95 | post :create, {:count => { "option" => "invalid value" }}, valid_session
96 | response.should render_template("new")
97 | end
98 | end
99 | end
100 |
101 | describe "PUT update" do
102 | describe "with valid params" do
103 | it "updates the requested count" do
104 | count = Count.create! valid_attributes
105 | # Assuming there are no other counts in the database, this
106 | # specifies that the Count created on the previous line
107 | # receives the :update_attributes message with whatever params are
108 | # submitted in the request.
109 | Count.any_instance.should_receive(:update_attributes).with({ "option" => "MyString" })
110 | put :update, {:id => count.to_param, :count => { "option" => "MyString" }}, valid_session
111 | end
112 |
113 | it "assigns the requested count as @count" do
114 | count = Count.create! valid_attributes
115 | put :update, {:id => count.to_param, :count => valid_attributes}, valid_session
116 | assigns(:count).should eq(count)
117 | end
118 |
119 | it "redirects to the count" do
120 | count = Count.create! valid_attributes
121 | put :update, {:id => count.to_param, :count => valid_attributes}, valid_session
122 | response.should redirect_to(count)
123 | end
124 | end
125 |
126 | describe "with invalid params" do
127 | it "assigns the count as @count" do
128 | count = Count.create! valid_attributes
129 | # Trigger the behavior that occurs when invalid params are submitted
130 | Count.any_instance.stub(:save).and_return(false)
131 | put :update, {:id => count.to_param, :count => { "option" => "invalid value" }}, valid_session
132 | assigns(:count).should eq(count)
133 | end
134 |
135 | it "re-renders the 'edit' template" do
136 | count = Count.create! valid_attributes
137 | # Trigger the behavior that occurs when invalid params are submitted
138 | Count.any_instance.stub(:save).and_return(false)
139 | put :update, {:id => count.to_param, :count => { "option" => "invalid value" }}, valid_session
140 | response.should render_template("edit")
141 | end
142 | end
143 | end
144 |
145 | describe "DELETE destroy" do
146 | it "destroys the requested count" do
147 | count = Count.create! valid_attributes
148 | expect {
149 | delete :destroy, {:id => count.to_param}, valid_session
150 | }.to change(Count, :count).by(-1)
151 | end
152 |
153 | it "redirects to the counts list" do
154 | count = Count.create! valid_attributes
155 | delete :destroy, {:id => count.to_param}, valid_session
156 | response.should redirect_to(counts_url)
157 | end
158 | end
159 |
160 | end
161 |
--------------------------------------------------------------------------------
/spec/controllers/motions_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | # This spec was generated by rspec-rails when you ran the scaffold generator.
4 | # It demonstrates how one might use RSpec to specify the controller code that
5 | # was generated by Rails when you ran the scaffold generator.
6 | #
7 | # It assumes that the implementation code is generated by the rails scaffold
8 | # generator. If you are using any extension libraries to generate different
9 | # controller code, this generated spec may or may not pass.
10 | #
11 | # It only uses APIs available in rails and/or rspec-rails. There are a number
12 | # of tools you can use to make these specs even more expressive, but we're
13 | # sticking to rails and rspec-rails APIs to keep things simple and stable.
14 | #
15 | # Compared to earlier versions of this generator, there is very limited use of
16 | # stubs and message expectations in this spec. Stubs are only used when there
17 | # is no simpler way to get a handle on the object needed for the example.
18 | # Message expectations are only used when there is no simpler way to specify
19 | # that an instance is receiving a specific message.
20 |
21 | describe MotionsController do
22 |
23 | # This should return the minimal set of attributes required to create a valid
24 | # Motion. As you add validations to Motion, be sure to
25 | # adjust the attributes here as well.
26 | let(:valid_attributes) { { "organization" => "MyString" } }
27 |
28 | # This should return the minimal set of values that should be in the session
29 | # in order to pass any filters (e.g. authentication) defined in
30 | # MotionsController. Be sure to keep this updated too.
31 | let(:valid_session) { {} }
32 |
33 | describe "GET index" do
34 | it "assigns all motions as @motions" do
35 | motion = Motion.create! valid_attributes
36 | get :index, {}, valid_session
37 | assigns(:motions).should eq([motion])
38 | end
39 | end
40 |
41 | describe "GET show" do
42 | it "assigns the requested motion as @motion" do
43 | motion = Motion.create! valid_attributes
44 | get :show, {:id => motion.to_param}, valid_session
45 | assigns(:motion).should eq(motion)
46 | end
47 |
48 | it "returns the correct motion in json format" do
49 | motion = FactoryGirl.create(:motion)
50 | get :show, id: motion.id, format: :json
51 | response.should be_success
52 | response.body.should eq(assigns(:motion).to_json)
53 | end
54 | end
55 |
56 | describe "GET new" do
57 | it "assigns a new motion as @motion" do
58 | get :new, {}, valid_session
59 | assigns(:motion).should be_a_new(Motion)
60 | end
61 | end
62 |
63 | describe "GET edit" do
64 | it "assigns the requested motion as @motion" do
65 | motion = Motion.create! valid_attributes
66 | get :edit, {:id => motion.to_param}, valid_session
67 | assigns(:motion).should eq(motion)
68 | end
69 | end
70 |
71 | describe "POST create" do
72 | describe "with valid params" do
73 | it "creates a new Motion" do
74 | expect {
75 | post :create, {:motion => valid_attributes}, valid_session
76 | }.to change(Motion, :count).by(1)
77 | end
78 |
79 | it "assigns a newly created motion as @motion" do
80 | post :create, {:motion => valid_attributes}, valid_session
81 | assigns(:motion).should be_a(Motion)
82 | assigns(:motion).should be_persisted
83 | end
84 |
85 | it "redirects to the created motion" do
86 | post :create, {:motion => valid_attributes}, valid_session
87 | response.should redirect_to(Motion.last)
88 | end
89 | end
90 |
91 | describe "with invalid params" do
92 | it "assigns a newly created but unsaved motion as @motion" do
93 | # Trigger the behavior that occurs when invalid params are submitted
94 | Motion.any_instance.stub(:save).and_return(false)
95 | post :create, {:motion => { "organization" => "invalid value" }}, valid_session
96 | assigns(:motion).should be_a_new(Motion)
97 | end
98 |
99 | # it "re-renders the 'new' template" do
100 | # # Trigger the behavior that occurs when invalid params are submitted
101 | # Motion.any_instance.stub(:save).and_return(false)
102 | # post :create, {:motion => { "organization" => "invalid value" }}, valid_session
103 | # response.should render_template("new")
104 | # end
105 | end
106 | end
107 |
108 | describe "PUT update" do
109 | describe "with valid params" do
110 | it "updates the requested motion" do
111 | motion = Motion.create! valid_attributes
112 | # Assuming there are no other motions in the database, this
113 | # specifies that the Motion created on the previous line
114 | # receives the :update_attributes message with whatever params are
115 | # submitted in the request.
116 | Motion.any_instance.should_receive(:update_attributes).with({ "organization" => "MyString" })
117 | put :update, {:id => motion.to_param, :motion => { "organization" => "MyString" }}, valid_session
118 | end
119 |
120 | it "assigns the requested motion as @motion" do
121 | motion = Motion.create! valid_attributes
122 | put :update, {:id => motion.to_param, :motion => valid_attributes}, valid_session
123 | assigns(:motion).should eq(motion)
124 | end
125 |
126 | it "redirects to the motion" do
127 | motion = Motion.create! valid_attributes
128 | put :update, {:id => motion.to_param, :motion => valid_attributes}, valid_session
129 | response.should redirect_to(motion)
130 | end
131 | end
132 |
133 | describe "with invalid params" do
134 | it "assigns the motion as @motion" do
135 | motion = Motion.create! valid_attributes
136 | # Trigger the behavior that occurs when invalid params are submitted
137 | Motion.any_instance.stub(:save).and_return(false)
138 | put :update, {:id => motion.to_param, :motion => { "organization" => "invalid value" }}, valid_session
139 | assigns(:motion).should eq(motion)
140 | end
141 |
142 | # it "re-renders the 'edit' template" do
143 | # motion = Motion.create! valid_attributes
144 | # # Trigger the behavior that occurs when invalid params are submitted
145 | # Motion.any_instance.stub(:save).and_return(false)
146 | # put :update, {:id => motion.to_param, :motion => { "organization" => "invalid value" }}, valid_session
147 | # response.should render_template("edit")
148 | # end
149 | end
150 | end
151 |
152 | describe "DELETE destroy" do
153 | it "destroys the requested motion" do
154 | motion = Motion.create! valid_attributes
155 | expect {
156 | delete :destroy, {:id => motion.to_param}, valid_session
157 | }.to change(Motion, :count).by(-1)
158 | end
159 |
160 | it "redirects to the motions list" do
161 | motion = Motion.create! valid_attributes
162 | delete :destroy, {:id => motion.to_param}, valid_session
163 | response.should redirect_to(motions_url)
164 | end
165 | end
166 |
167 | end
168 |
--------------------------------------------------------------------------------
/spec/controllers/paperworks_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | # This spec was generated by rspec-rails when you ran the scaffold generator.
4 | # It demonstrates how one might use RSpec to specify the controller code that
5 | # was generated by Rails when you ran the scaffold generator.
6 | #
7 | # It assumes that the implementation code is generated by the rails scaffold
8 | # generator. If you are using any extension libraries to generate different
9 | # controller code, this generated spec may or may not pass.
10 | #
11 | # It only uses APIs available in rails and/or rspec-rails. There are a number
12 | # of tools you can use to make these specs even more expressive, but we're
13 | # sticking to rails and rspec-rails APIs to keep things simple and stable.
14 | #
15 | # Compared to earlier versions of this generator, there is very limited use of
16 | # stubs and message expectations in this spec. Stubs are only used when there
17 | # is no simpler way to get a handle on the object needed for the example.
18 | # Message expectations are only used when there is no simpler way to specify
19 | # that an instance is receiving a specific message.
20 |
21 | describe PaperworksController do
22 |
23 | # This should return the minimal set of attributes required to create a valid
24 | # Paperwork. As you add validations to Paperwork, be sure to
25 | # adjust the attributes here as well.
26 | let(:valid_attributes) { { "session" => "MyString" } }
27 |
28 | # This should return the minimal set of values that should be in the session
29 | # in order to pass any filters (e.g. authentication) defined in
30 | # PaperworksController. Be sure to keep this updated too.
31 | let(:valid_session) { {} }
32 |
33 | describe "GET index", broken: true do
34 | it "assigns all paperworks as @paperworks" do
35 | paperwork = Paperwork.create! valid_attributes
36 | get :index, {}, valid_session
37 | assigns(:paperworks).should eq([paperwork])
38 | end
39 | end
40 |
41 | describe "GET show", broken: true do
42 | it "assigns the requested paperwork as @paperwork" do
43 | paperwork = Paperwork.create! valid_attributes
44 | get :show, {:id => paperwork.to_param}, valid_session
45 | assigns(:paperwork).should eq(paperwork)
46 | end
47 | end
48 |
49 | describe "GET new", broken: true do
50 | it "assigns a new paperwork as @paperwork" do
51 | get :new, {}, valid_session
52 | assigns(:paperwork).should be_a_new(Paperwork)
53 | end
54 | end
55 |
56 | describe "GET edit", broken: true do
57 | it "assigns the requested paperwork as @paperwork" do
58 | paperwork = Paperwork.create! valid_attributes
59 | get :edit, {:id => paperwork.to_param}, valid_session
60 | assigns(:paperwork).should eq(paperwork)
61 | end
62 | end
63 |
64 | describe "GET search" do
65 |
66 | before(:each) do
67 | @paperwork1 = FactoryGirl.build(:paperwork1)
68 | @paperwork2 = FactoryGirl.build(:paperwork2)
69 | @bill = FactoryGirl.create(:bill1)
70 | @bill.paperworks = [@paperwork1, @paperwork2]
71 | @bill.save
72 | @paperwork1.save
73 | @paperwork2.save
74 | Sunspot.remove_all(Paperwork)
75 | Sunspot.index!(Paperwork.all)
76 | end
77 |
78 | it "searches over a date range" do
79 | get :search, date_min: "2012-01-01T00:00:00Z", date_max: "2013-06-06T00:00:00Z", format: :json
80 | assigns(:paperworks).should eq([@paperwork2])
81 | end
82 |
83 | context "doing a simple 'q' query" do
84 | context "with a single result" do
85 | it "assigns query results to @paperworks" do
86 | get :search, q: "Ingreso de proyecto", format: :json
87 | assigns(:paperworks).should eq([@paperwork1])
88 | end
89 | end
90 |
91 | context "with multiple results" do
92 | it "assigns multiple query results to @paperworks" do
93 | get :search, q: "trámite", format: :json
94 | assigns(:paperworks).should eq([@paperwork1, @paperwork2])
95 | end
96 |
97 | it "paginates results", broken: true do
98 | get :search, q: "", per_page: '1', page: '1', format: :json
99 | assigns(:bills).should eq([@paperwork1])
100 | get :search, q: "", per_page: '1', page: '2', format: :json
101 | assigns(:bills).should eq([@paperwork2])
102 | end
103 | end
104 | end
105 | end
106 |
107 | describe "POST create", broken: true do
108 | describe "with valid params" do
109 | it "creates a new Paperwork" do
110 | expect {
111 | post :create, {:paperwork => valid_attributes}, valid_session
112 | }.to change(Paperwork, :count).by(1)
113 | end
114 |
115 | it "assigns a newly created paperwork as @paperwork" do
116 | post :create, {:paperwork => valid_attributes}, valid_session
117 | assigns(:paperwork).should be_a(Paperwork)
118 | assigns(:paperwork).should be_persisted
119 | end
120 |
121 | it "redirects to the created paperwork" do
122 | post :create, {:paperwork => valid_attributes}, valid_session
123 | response.should redirect_to(Paperwork.last)
124 | end
125 | end
126 |
127 | describe "with invalid params" do
128 | it "assigns a newly created but unsaved paperwork as @paperwork" do
129 | # Trigger the behavior that occurs when invalid params are submitted
130 | Paperwork.any_instance.stub(:save).and_return(false)
131 | post :create, {:paperwork => { "session" => "invalid value" }}, valid_session
132 | assigns(:paperwork).should be_a_new(Paperwork)
133 | end
134 |
135 | it "re-renders the 'new' template" do
136 | # Trigger the behavior that occurs when invalid params are submitted
137 | Paperwork.any_instance.stub(:save).and_return(false)
138 | post :create, {:paperwork => { "session" => "invalid value" }}, valid_session
139 | response.should render_template("new")
140 | end
141 | end
142 | end
143 |
144 | describe "PUT update", broken: true do
145 | describe "with valid params" do
146 | it "updates the requested paperwork" do
147 | paperwork = Paperwork.create! valid_attributes
148 | # Assuming there are no other paperworks in the database, this
149 | # specifies that the Paperwork created on the previous line
150 | # receives the :update_attributes message with whatever params are
151 | # submitted in the request.
152 | Paperwork.any_instance.should_receive(:update_attributes).with({ "session" => "MyString" })
153 | put :update, {:id => paperwork.to_param, :paperwork => { "session" => "MyString" }}, valid_session
154 | end
155 |
156 | it "assigns the requested paperwork as @paperwork" do
157 | paperwork = Paperwork.create! valid_attributes
158 | put :update, {:id => paperwork.to_param, :paperwork => valid_attributes}, valid_session
159 | assigns(:paperwork).should eq(paperwork)
160 | end
161 |
162 | it "redirects to the paperwork" do
163 | paperwork = Paperwork.create! valid_attributes
164 | put :update, {:id => paperwork.to_param, :paperwork => valid_attributes}, valid_session
165 | response.should redirect_to(paperwork)
166 | end
167 | end
168 |
169 | describe "with invalid params" do
170 | it "assigns the paperwork as @paperwork" do
171 | paperwork = Paperwork.create! valid_attributes
172 | # Trigger the behavior that occurs when invalid params are submitted
173 | Paperwork.any_instance.stub(:save).and_return(false)
174 | put :update, {:id => paperwork.to_param, :paperwork => { "session" => "invalid value" }}, valid_session
175 | assigns(:paperwork).should eq(paperwork)
176 | end
177 |
178 | it "re-renders the 'edit' template" do
179 | paperwork = Paperwork.create! valid_attributes
180 | # Trigger the behavior that occurs when invalid params are submitted
181 | Paperwork.any_instance.stub(:save).and_return(false)
182 | put :update, {:id => paperwork.to_param, :paperwork => { "session" => "invalid value" }}, valid_session
183 | response.should render_template("edit")
184 | end
185 | end
186 | end
187 |
188 | describe "DELETE destroy", broken: true do
189 | it "destroys the requested paperwork" do
190 | paperwork = Paperwork.create! valid_attributes
191 | expect {
192 | delete :destroy, {:id => paperwork.to_param}, valid_session
193 | }.to change(Paperwork, :count).by(-1)
194 | end
195 |
196 | it "redirects to the paperworks list" do
197 | paperwork = Paperwork.create! valid_attributes
198 | delete :destroy, {:id => paperwork.to_param}, valid_session
199 | response.should redirect_to(paperworks_url)
200 | end
201 | end
202 |
203 | end
204 |
--------------------------------------------------------------------------------
/spec/controllers/vote_events_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | # This spec was generated by rspec-rails when you ran the scaffold generator.
4 | # It demonstrates how one might use RSpec to specify the controller code that
5 | # was generated by Rails when you ran the scaffold generator.
6 | #
7 | # It assumes that the implementation code is generated by the rails scaffold
8 | # generator. If you are using any extension libraries to generate different
9 | # controller code, this generated spec may or may not pass.
10 | #
11 | # It only uses APIs available in rails and/or rspec-rails. There are a number
12 | # of tools you can use to make these specs even more expressive, but we're
13 | # sticking to rails and rspec-rails APIs to keep things simple and stable.
14 | #
15 | # Compared to earlier versions of this generator, there is very limited use of
16 | # stubs and message expectations in this spec. Stubs are only used when there
17 | # is no simpler way to get a handle on the object needed for the example.
18 | # Message expectations are only used when there is no simpler way to specify
19 | # that an instance is receiving a specific message.
20 |
21 | describe VoteEventsController, pending: "not clear what methods it should have" do
22 |
23 | # This should return the minimal set of attributes required to create a valid
24 | # VoteEvent. As you add validations to VoteEvent, be sure to
25 | # adjust the attributes here as well.
26 | let(:valid_attributes) { { "start_date" => "2014-05-28 17:07:28" } }
27 |
28 | # This should return the minimal set of values that should be in the session
29 | # in order to pass any filters (e.g. authentication) defined in
30 | # VoteEventsController. Be sure to keep this updated too.
31 | let(:valid_session) { {} }
32 |
33 | describe "GET index" do
34 | it "assigns all vote_events as @vote_events" do
35 | vote_event = VoteEvent.create! valid_attributes
36 | get :index, {}, valid_session
37 | assigns(:vote_events).should eq([vote_event])
38 | end
39 | end
40 |
41 | describe "GET show" do
42 | it "assigns the requested vote_event as @vote_event" do
43 | vote_event = VoteEvent.create! valid_attributes
44 | get :show, {:id => vote_event.to_param}, valid_session
45 | assigns(:vote_event).should eq(vote_event)
46 | end
47 | end
48 |
49 | describe "GET new" do
50 | it "assigns a new vote_event as @vote_event" do
51 | get :new, {}, valid_session
52 | assigns(:vote_event).should be_a_new(VoteEvent)
53 | end
54 | end
55 |
56 | describe "GET edit" do
57 | it "assigns the requested vote_event as @vote_event" do
58 | vote_event = VoteEvent.create! valid_attributes
59 | get :edit, {:id => vote_event.to_param}, valid_session
60 | assigns(:vote_event).should eq(vote_event)
61 | end
62 | end
63 |
64 | describe "POST create" do
65 | describe "with valid params" do
66 | it "creates a new VoteEvent" do
67 | expect {
68 | post :create, {:vote_event => valid_attributes}, valid_session
69 | }.to change(VoteEvent, :count).by(1)
70 | end
71 |
72 | it "assigns a newly created vote_event as @vote_event" do
73 | post :create, {:vote_event => valid_attributes}, valid_session
74 | assigns(:vote_event).should be_a(VoteEvent)
75 | assigns(:vote_event).should be_persisted
76 | end
77 |
78 | it "redirects to the created vote_event" do
79 | post :create, {:vote_event => valid_attributes}, valid_session
80 | response.should redirect_to(VoteEvent.last)
81 | end
82 | end
83 |
84 | describe "with invalid params" do
85 | it "assigns a newly created but unsaved vote_event as @vote_event" do
86 | # Trigger the behavior that occurs when invalid params are submitted
87 | VoteEvent.any_instance.stub(:save).and_return(false)
88 | post :create, {:vote_event => { "start_date" => "invalid value" }}, valid_session
89 | assigns(:vote_event).should be_a_new(VoteEvent)
90 | end
91 |
92 | it "re-renders the 'new' template" do
93 | # Trigger the behavior that occurs when invalid params are submitted
94 | VoteEvent.any_instance.stub(:save).and_return(false)
95 | post :create, {:vote_event => { "start_date" => "invalid value" }}, valid_session
96 | response.should render_template("new")
97 | end
98 | end
99 | end
100 |
101 | describe "PUT update" do
102 | describe "with valid params" do
103 | it "updates the requested vote_event" do
104 | vote_event = VoteEvent.create! valid_attributes
105 | # Assuming there are no other vote_events in the database, this
106 | # specifies that the VoteEvent created on the previous line
107 | # receives the :update_attributes message with whatever params are
108 | # submitted in the request.
109 | VoteEvent.any_instance.should_receive(:update_attributes).with({ "start_date" => "2014-05-28 17:07:28" })
110 | put :update, {:id => vote_event.to_param, :vote_event => { "start_date" => "2014-05-28 17:07:28" }}, valid_session
111 | end
112 |
113 | it "assigns the requested vote_event as @vote_event" do
114 | vote_event = VoteEvent.create! valid_attributes
115 | put :update, {:id => vote_event.to_param, :vote_event => valid_attributes}, valid_session
116 | assigns(:vote_event).should eq(vote_event)
117 | end
118 |
119 | it "redirects to the vote_event" do
120 | vote_event = VoteEvent.create! valid_attributes
121 | put :update, {:id => vote_event.to_param, :vote_event => valid_attributes}, valid_session
122 | response.should redirect_to(vote_event)
123 | end
124 | end
125 |
126 | describe "with invalid params" do
127 | it "assigns the vote_event as @vote_event" do
128 | vote_event = VoteEvent.create! valid_attributes
129 | # Trigger the behavior that occurs when invalid params are submitted
130 | VoteEvent.any_instance.stub(:save).and_return(false)
131 | put :update, {:id => vote_event.to_param, :vote_event => { "start_date" => "invalid value" }}, valid_session
132 | assigns(:vote_event).should eq(vote_event)
133 | end
134 |
135 | it "re-renders the 'edit' template" do
136 | vote_event = VoteEvent.create! valid_attributes
137 | # Trigger the behavior that occurs when invalid params are submitted
138 | VoteEvent.any_instance.stub(:save).and_return(false)
139 | put :update, {:id => vote_event.to_param, :vote_event => { "start_date" => "invalid value" }}, valid_session
140 | response.should render_template("edit")
141 | end
142 | end
143 | end
144 |
145 | describe "DELETE destroy" do
146 | it "destroys the requested vote_event" do
147 | vote_event = VoteEvent.create! valid_attributes
148 | expect {
149 | delete :destroy, {:id => vote_event.to_param}, valid_session
150 | }.to change(VoteEvent, :count).by(-1)
151 | end
152 |
153 | it "redirects to the vote_events list" do
154 | vote_event = VoteEvent.create! valid_attributes
155 | delete :destroy, {:id => vote_event.to_param}, valid_session
156 | response.should redirect_to(vote_events_url)
157 | end
158 | end
159 |
160 | end
161 |
--------------------------------------------------------------------------------
/spec/controllers/votes_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | # This spec was generated by rspec-rails when you ran the scaffold generator.
4 | # It demonstrates how one might use RSpec to specify the controller code that
5 | # was generated by Rails when you ran the scaffold generator.
6 | #
7 | # It assumes that the implementation code is generated by the rails scaffold
8 | # generator. If you are using any extension libraries to generate different
9 | # controller code, this generated spec may or may not pass.
10 | #
11 | # It only uses APIs available in rails and/or rspec-rails. There are a number
12 | # of tools you can use to make these specs even more expressive, but we're
13 | # sticking to rails and rspec-rails APIs to keep things simple and stable.
14 | #
15 | # Compared to earlier versions of this generator, there is very limited use of
16 | # stubs and message expectations in this spec. Stubs are only used when there
17 | # is no simpler way to get a handle on the object needed for the example.
18 | # Message expectations are only used when there is no simpler way to specify
19 | # that an instance is receiving a specific message.
20 |
21 | describe VotesController, pending: "not clear what methods it should have" do
22 |
23 | # This should return the minimal set of attributes required to create a valid
24 | # Vote. As you add validations to Vote, be sure to
25 | # adjust the attributes here as well.
26 | let(:valid_attributes) { { "voter_id" => "" } }
27 |
28 | # This should return the minimal set of values that should be in the session
29 | # in order to pass any filters (e.g. authentication) defined in
30 | # VotesController. Be sure to keep this updated too.
31 | let(:valid_session) { {} }
32 |
33 | describe "GET index" do
34 | it "assigns all votes as @votes" do
35 | vote = Vote.create! valid_attributes
36 | get :index, {}, valid_session
37 | assigns(:votes).should eq([vote])
38 | end
39 | end
40 |
41 | describe "GET show" do
42 | it "assigns the requested vote as @vote" do
43 | vote = Vote.create! valid_attributes
44 | get :show, {:id => vote.to_param}, valid_session
45 | assigns(:vote).should eq(vote)
46 | end
47 | end
48 |
49 | describe "GET new" do
50 | it "assigns a new vote as @vote" do
51 | get :new, {}, valid_session
52 | assigns(:vote).should be_a_new(Vote)
53 | end
54 | end
55 |
56 | describe "GET edit" do
57 | it "assigns the requested vote as @vote" do
58 | vote = Vote.create! valid_attributes
59 | get :edit, {:id => vote.to_param}, valid_session
60 | assigns(:vote).should eq(vote)
61 | end
62 | end
63 |
64 | describe "POST create" do
65 | describe "with valid params" do
66 | it "creates a new Vote" do
67 | expect {
68 | post :create, {:vote => valid_attributes}, valid_session
69 | }.to change(Vote, :count).by(1)
70 | end
71 |
72 | it "assigns a newly created vote as @vote" do
73 | post :create, {:vote => valid_attributes}, valid_session
74 | assigns(:vote).should be_a(Vote)
75 | assigns(:vote).should be_persisted
76 | end
77 |
78 | it "redirects to the created vote" do
79 | post :create, {:vote => valid_attributes}, valid_session
80 | response.should redirect_to(Vote.last)
81 | end
82 | end
83 |
84 | describe "with invalid params" do
85 | it "assigns a newly created but unsaved vote as @vote" do
86 | # Trigger the behavior that occurs when invalid params are submitted
87 | Vote.any_instance.stub(:save).and_return(false)
88 | post :create, {:vote => { "voter_id" => "invalid value" }}, valid_session
89 | assigns(:vote).should be_a_new(Vote)
90 | end
91 |
92 | it "re-renders the 'new' template" do
93 | # Trigger the behavior that occurs when invalid params are submitted
94 | Vote.any_instance.stub(:save).and_return(false)
95 | post :create, {:vote => { "voter_id" => "invalid value" }}, valid_session
96 | response.should render_template("new")
97 | end
98 | end
99 | end
100 |
101 | describe "PUT update" do
102 | describe "with valid params" do
103 | it "updates the requested vote" do
104 | vote = Vote.create! valid_attributes
105 | # Assuming there are no other votes in the database, this
106 | # specifies that the Vote created on the previous line
107 | # receives the :update_attributes message with whatever params are
108 | # submitted in the request.
109 | Vote.any_instance.should_receive(:update_attributes).with({ "voter_id" => "" })
110 | put :update, {:id => vote.to_param, :vote => { "voter_id" => "" }}, valid_session
111 | end
112 |
113 | it "assigns the requested vote as @vote" do
114 | vote = Vote.create! valid_attributes
115 | put :update, {:id => vote.to_param, :vote => valid_attributes}, valid_session
116 | assigns(:vote).should eq(vote)
117 | end
118 |
119 | it "redirects to the vote" do
120 | vote = Vote.create! valid_attributes
121 | put :update, {:id => vote.to_param, :vote => valid_attributes}, valid_session
122 | response.should redirect_to(vote)
123 | end
124 | end
125 |
126 | describe "with invalid params" do
127 | it "assigns the vote as @vote" do
128 | vote = Vote.create! valid_attributes
129 | # Trigger the behavior that occurs when invalid params are submitted
130 | Vote.any_instance.stub(:save).and_return(false)
131 | put :update, {:id => vote.to_param, :vote => { "voter_id" => "invalid value" }}, valid_session
132 | assigns(:vote).should eq(vote)
133 | end
134 |
135 | it "re-renders the 'edit' template" do
136 | vote = Vote.create! valid_attributes
137 | # Trigger the behavior that occurs when invalid params are submitted
138 | Vote.any_instance.stub(:save).and_return(false)
139 | put :update, {:id => vote.to_param, :vote => { "voter_id" => "invalid value" }}, valid_session
140 | response.should render_template("edit")
141 | end
142 | end
143 | end
144 |
145 | describe "DELETE destroy" do
146 | it "destroys the requested vote" do
147 | vote = Vote.create! valid_attributes
148 | expect {
149 | delete :destroy, {:id => vote.to_param}, valid_session
150 | }.to change(Vote, :count).by(-1)
151 | end
152 |
153 | it "redirects to the votes list" do
154 | vote = Vote.create! valid_attributes
155 | delete :destroy, {:id => vote.to_param}, valid_session
156 | response.should redirect_to(votes_url)
157 | end
158 | end
159 |
160 | end
161 |
--------------------------------------------------------------------------------
/spec/example_files/boletin_3773-06.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/spec/example_files/boletin_3773-06.doc
--------------------------------------------------------------------------------
/spec/example_files/ley_19029.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | "Artículo 1°.- Introdúcense las siguientes modificaciones al Código de Justicia Militar: 1) Reemplázanse en el encabezamiento del artículo 245 la frase "presidio militar mayor en su grado máximo a muerte", por la frase "presidio militar mayor en su grado máximo a presidio militar perpetuo". 2) Reemplázanse en el número 1° del artículo 245 las palabras "que pueda favorecer" por "que favorezca", y el término "perjudicar "por perjudique" respectivamente. 3) Suprímese en el artículo 247 la expresión final "a muerte". 4) Refúndense el encabezamiento del artículo 248 con su número 1°, reemplazado en los siguientes términos: "Artículo 248.- Incurrirá en la pena de presidio mayor en su grado máximo a presidio perpetuo el que pusiere en libertad a prisioneros de guerra con el objeto de que regresen a las filas enemigas". 5) Derógase el número 2° del artículo 248. 6) Elimínase en el artículo 252 la expresión "a muerte". 7) Reemplázase en el inciso segundo del artículo 263 la frase "la de muerte", por la frase "la de presidio perpetuo". 8) Reemplázase en el inciso primero del artículo 300, la frase "presidio militar mayor en su grado máximo a muerte" por la frase "presidio militar mayor en su grado máximo a presidio militar perpetuo". Elimínase en el inciso segundo del mismo artículo, la frase "a presidio militar perpetuo". 9) Reemplázase en el número 1° del artículo 301 la frase "presidio militar mayor en su grado máximo a muerte", por la frase "presidio militar mayor en su grado máximo a presidio militar perpetuo". 10) Reemplázase el artículo 305 por el siguiente: "Artículo 305.- Cualquier otro militar que abandonare los servicios en los casos a que se refieren los números 1° a 4° del artículo anterior, será castigado con las penas que cada uno de ellos contempla, rebajadas en un grado.". 11) Reemplázanse en el artículo 310 las frases "presidio militar perpetuo a muerte" y "presidio militar mayor en su grado medio a presidio militar perpetuo" por las frases "presidio militar perpetuo" y "presidio militar mayor en su grado medio a presidio militar mayor en su grado máximo", respectivamente. 12) Reemplázase en el número 1° del inciso primero del artículo 320, la frase "presidio militar mayor en su grado máximo a muerte", por la frase "presidio militar mayor en su grado máximo a presidio militar perpetuo". 13) Reemplázase en el número 1° del artículo 331 la frase "presidio mayor en su grado medio a muerte" por la frase "presidio mayor en su grado medio a presidio perpetuo". 14) Reemplázase en el inciso primero del artículo 346 la frase "presidio mayor en su grado máximo a muerte" por la frase "presidio mayor en su grado máximo a presidio perpetuo". 15) Reemplázase en el inciso segundo del artículo 348 la frase "presidio mayor en su grado máximo a muerte" por la frase "presidio mayor en su grado medio a presidio perpetuo". 16) Reemplázase en el inciso primero del artículo 350 la frase "presidio perpetuo a muerte" por "presidio mayor en su grado medio a presidio perpetuo". En su inciso segundo, reemplázase la frase "presidio perpetuo" por "presidio mayor en su grado máximo". 17) Reemplázase en el inciso primero del artículo 351 la frase "presidio mayor en su grado máximo a presidio perpetuo" por la frase "presidio mayor en su grado medio a máximo". 18) Reemplázase en el inciso final del artículo 372, la expresión "muerte" por la frase "presidio perpetuo". 19) Reemplázase el artículo 375, por el siguiente: "Artículo 375.- En caso de sublevación o motín de prisioneros de guerra, los participantes sufrirán la pena de presidio mayor en cualquiera de sus grados, y en el caso de los cabecillas, la pena podrá elevarse hasta la de presidio perpetuo. Lo anterior es sin perjuicio de lo que pueda acordarse en los tratados de paz o pactos de tregua". 20) Reemplázase en el artículo 381, la frase "presidio mayor en su grado máximo a muerte" por la frase "presidio mayor en su grado máximo a presidio perpetuo".
5 |
6 |
7 |
--------------------------------------------------------------------------------
/spec/factories/admin_users.rb:
--------------------------------------------------------------------------------
1 | # Read about factories at https://github.com/thoughtbot/factory_girl
2 |
3 | FactoryGirl.define do
4 | factory :admin_user do
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/spec/factories/bills.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | FactoryGirl.define do
3 | factory :bill do
4 |
5 | uid '0-0'
6 |
7 | factory :bill1 do |f|
8 | f.uid "1-07"
9 | f.title "Modifica los Códigos de Justicia Militar, Penal y Aeronáutico para abolir la Pena de Muerte."
10 | f.abstract "Abolición de la pena de muerte."
11 | f.tags ["pena de muerte", "justicia"]
12 | f.subject_areas ["Derechos Fundamentales"]
13 | f.stage "Tramitación terminada"
14 | f.creation_date "1990-03-20T00:00:00Z"
15 | f.publish_date "1991-01-23T00:00:00Z"
16 | f.authors []
17 | f.initial_chamber "C.Diputados"
18 | f.resulting_document "Ley Nº 19.029"
19 | end
20 | factory :bill2 do |f|
21 | f.uid "01-07"
22 | f.title "Fake bill with terms pena de muerte"
23 | f.abstract "Abolición de la pena de muerte."
24 | f.tags ["pena de muerte", "justicia"]
25 | f.subject_areas ["Derechos Fundamentales"]
26 | f.stage "Tramitación terminada"
27 | f.creation_date "1990-03-20T00:00:00Z"
28 | f.publish_date "1991-01-23T00:00:00Z"
29 | f.authors []
30 | f.initial_chamber "C.Diputados"
31 | f.resulting_document "Ley Nº 19.029"
32 | end
33 | factory :bill3 do |f|
34 | f.uid "3773-06"
35 | f.title "Sobre acceso a la información pública"
36 | f.abstract "Ley de transparencia"
37 | f.tags ["transparencia", "acceso a la informacion publica"]
38 | f.subject_areas ["Transparencia", "Participación"]
39 | f.stage "Tramitación terminada"
40 | f.creation_date "2005-01-04T00:00:00Z"
41 | f.publish_date "2008-08-11T00:00:00Z"
42 | f.authors ["Gazmuri Mujica, Jaime", "Larraín Fernández, Hernán"]
43 | f.initial_chamber "Senado"
44 | f.bill_draft_link "http://www.senado.cl/appsenado/index.php?mo=tramitacion&ac=getDocto&iddocto=202&tipodoc=compa"
45 | end
46 | factory :bill4 do |f|
47 | f.uid "03773-06"
48 | f.title "Fake bill with terms información pública"
49 | f.abstract "Ley de transparencia"
50 | f.tags ["transparencia", "acceso a la informacion publica"]
51 | f.subject_areas ["Transparencia", "Participación"]
52 | f.stage "Tramitación terminada"
53 | f.creation_date "2007-01-04T00:00:00Z"
54 | f.publish_date "2009-08-11T00:00:00Z"
55 | f.authors ["Gazmuri Mujica, Jorge", "Larraín Fernández, Hernán"]
56 | f.initial_chamber "C.Diputados"
57 | f.bill_draft_link "http://www.senado.cl/appsenado/index.php?mo=tramitacion&ac=getDocto&iddocto=202&tipodoc=compa"
58 | end
59 | end
60 | end
--------------------------------------------------------------------------------
/spec/factories/counts.rb:
--------------------------------------------------------------------------------
1 | # Read about factories at https://github.com/thoughtbot/factory_girl
2 |
3 | FactoryGirl.define do
4 | factory :count do
5 | option "si"
6 | value 42
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/factories/documents.rb:
--------------------------------------------------------------------------------
1 | FactoryGirl.define do
2 | factory :document, :class => 'Document' do
3 |
4 | factory :document1 do |b|
5 | b.date "2014-01-01 11:35:01"
6 | b.step "Ingreso de proyecto ."
7 | b.stage "Primer trámite constitucional"
8 | b.link "http://document-example-site.org"
9 | end
10 |
11 | factory :inconsistent_data_document do |b|
12 | b.date "2014-01-01 11:35:01"
13 | b.step "Ingreso de proyecto ."
14 | b.stage "Primer tramite cónstitucional . "
15 | b.link "http://docuent-example-site.org"
16 | end
17 | end
18 | end
--------------------------------------------------------------------------------
/spec/factories/motions.rb:
--------------------------------------------------------------------------------
1 | # Read about factories at https://github.com/thoughtbot/factory_girl
2 |
3 | FactoryGirl.define do
4 | factory :motion do
5 | organization "MyString"
6 | context "MyString"
7 | creator "MyString"
8 | text "MyString"
9 | date "2014-05-28 17:03:01"
10 | requirement "MyString"
11 | result "MyString"
12 | session "MyString"
13 | vote_events { [FactoryGirl.build(:vote_event)] }
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/spec/factories/paperworks.rb:
--------------------------------------------------------------------------------
1 | # Read about factories at https://github.com/thoughtbot/factory_girl
2 |
3 | FactoryGirl.define do
4 | factory :paperwork, :class => 'Paperwork' do
5 |
6 | factory :paperwork1 do |b|
7 | b.session "/"
8 | b.date "2014-01-01 11:35:01"
9 | b.description "Ingreso de proyecto ."
10 | b.stage "Primer trámite constitucional"
11 | b.chamber "C.Diputados"
12 | end
13 | factory :paperwork2 do |b|
14 | b.session "20/343"
15 | b.date "2013-01-01 11:35:01"
16 | b.description "Oficio de ley al Ejecutivo ."
17 | b.stage "Trámite finalización en Cámara de Origen"
18 | b.chamber "Senado"
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/spec/factories/priorities.rb:
--------------------------------------------------------------------------------
1 | FactoryGirl.define do
2 | factory :priority, :class => 'Priority' do
3 |
4 | factory :priority1 do |p|
5 | p.type "Ingreso de proyecto ."
6 | p.entry_date "2014-01-01 11:35:01"
7 | end
8 |
9 | factory :priority2 do |p|
10 | p.type "Ingreso de proyecto ."
11 | p.entry_date "2014-01-01 11:35:01"
12 | end
13 | end
14 | end
--------------------------------------------------------------------------------
/spec/factories/reports.rb:
--------------------------------------------------------------------------------
1 | FactoryGirl.define do
2 | factory :report, :class => 'Report' do
3 |
4 | factory :report1 do |r|
5 | r.date "2014-01-01 11:35:01"
6 | r.step "Ingreso de proyecto ."
7 | r.stage "Primer trámite constitucional"
8 | r.link "http://report-example-site.org"
9 | end
10 | end
11 | end
--------------------------------------------------------------------------------
/spec/factories/vote_events.rb:
--------------------------------------------------------------------------------
1 | # Read about factories at https://github.com/thoughtbot/factory_girl
2 |
3 | FactoryGirl.define do
4 | factory :vote_event do
5 | start_date "2014-05-28 17:07:28"
6 | end_date "2014-05-28 17:07:28"
7 | counts { [FactoryGirl.build(:count)] }
8 | votes { [FactoryGirl.build(:vote)] }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/spec/factories/votes.rb:
--------------------------------------------------------------------------------
1 | # Read about factories at https://github.com/thoughtbot/factory_girl
2 |
3 | FactoryGirl.define do
4 | factory :vote do
5 | voter_id ""
6 | option "MyString"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/models/admin_user_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe AdminUser do
4 | pending "add some examples to (or delete) #{__FILE__}"
5 | end
6 |
--------------------------------------------------------------------------------
/spec/models/bill_spec.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | require 'spec_helper'
3 |
4 | describe Bill do
5 |
6 | it "has a valid factory" do
7 | FactoryGirl.create(:bill).should be_valid
8 | end
9 |
10 | it "is invalid without an uique id (uid)" do
11 | FactoryGirl.build(:bill, uid: nil).should_not be_valid
12 | end
13 |
14 | it "is invalid with an existing id (uid)" do
15 | FactoryGirl.create(:bill, uid: 123456)
16 | FactoryGirl.build(:bill, uid: 123456).should_not be_valid
17 | end
18 |
19 | it "saves tags in lowercase" do
20 | bill = FactoryGirl.create(:bill, uid: 123456)
21 | bill.tags = ['áéíóúüñ', 'ÑÜÚÓÍÉÁ']
22 | bill.save
23 | bill = Bill.find_by(uid: 123456)
24 | bill.tags.should eq(['aeiouuñ', 'ñuuoiea'])
25 | end
26 |
27 | it "creates the law_xml_link field when saved" do
28 | bill1 = FactoryGirl.create(:bill, uid: 1, resulting_document: "Ley Nº 20.000")
29 | bill2 = FactoryGirl.create(:bill, uid: 2, resulting_document: "D.S. Nº 1.358")
30 | bill1.save
31 | bill2.save
32 | bill1.law_xml_link.should eq("http://www.leychile.cl/Consulta/obtxml?opt=7&idLey=20000")
33 | bill2.law_xml_link.should be_nil
34 | end
35 |
36 | it "creates the law_web_link field when saved" do
37 | bill1 = FactoryGirl.create(:bill, uid: 1, resulting_document: "Ley Nº 20.000")
38 | bill2 = FactoryGirl.create(:bill, uid: 2, resulting_document: "D.S. Nº 1.358")
39 | bill1.save
40 | bill2.save
41 | bill1.law_web_link.should eq("http://www.leychile.cl/Navegar?idLey=20000")
42 | bill2.law_web_link.should be_nil
43 | end
44 |
45 | it "gets indexed after save" do
46 | search = Sunspot.search Bill do
47 | fulltext "pena"
48 | end
49 | search.results.count.should eq 0
50 | bill1 = FactoryGirl.create(:bill1)
51 | search = Sunspot.search Bill do
52 | fulltext "pena"
53 | end
54 | search.results.count.should eq 1
55 | end
56 |
57 | describe "current_priority" do
58 | it "returns the right priority" do
59 | bill1 = FactoryGirl.build(:bill1)
60 | priority1 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today)
61 | priority2 = FactoryGirl.create(:priority1, type: "Suma", entry_date: Date.yesterday)
62 | bill1.priorities = [priority1, priority2]
63 | bill1.save
64 | bill1.current_priority.should eq "Discusión inmediata"
65 | end
66 | it "returns the right value when no priority is set" do
67 | bill1 = FactoryGirl.create(:bill1)
68 | bill1.current_priority.should eq "Sin urgencia"
69 | end
70 | it "returns no priority value with future dates" do
71 | bill1 = FactoryGirl.create(:bill1)
72 | priority1 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.tomorrow)
73 | bill1.priorities = [priority1]
74 | bill1.save
75 | bill1.current_priority.should eq "Sin urgencia"
76 | end
77 | it "works with more than 1 priority" do
78 | bill1 = FactoryGirl.build(:bill1)
79 | priority1 = FactoryGirl.create(:priority1, type: "Simple", entry_date: Date.yesterday)
80 | priority2 = FactoryGirl.create(:priority1, type: "Suma", entry_date: Date.today)
81 | bill1.priorities = [priority1, priority2]
82 | bill1.save
83 | bill1.current_priority.should eq "Suma"
84 | end
85 | it "returns the right value when priority is outdated" do
86 | bill1 = FactoryGirl.build(:bill1)
87 | priority1 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: 6.days.ago)
88 | bill1.priorities = [priority1]
89 | bill1.save
90 | bill1.current_priority.should eq "Discusión inmediata"
91 | bill2 = FactoryGirl.build(:bill2)
92 | priority2 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: 7.days.ago)
93 | bill2.priorities = [priority2]
94 | bill2.save
95 | bill2.current_priority.should eq "Sin urgencia"
96 | end
97 | it "counts weekends" do
98 | Date.stub(:today){"2014-01-13".to_date}
99 | bill1 = FactoryGirl.build(:bill1)
100 | priority1 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today - 6)
101 | bill1.priorities = [priority1]
102 | bill1.save
103 | bill1.current_priority.should eq "Discusión inmediata"
104 |
105 | bill2 = FactoryGirl.build(:bill2)
106 | priority2 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today - 7)
107 | bill2.priorities = [priority2]
108 | bill2.save
109 | bill2.current_priority.should eq "Sin urgencia"
110 | end
111 | it "counts holidays" do
112 | Date.stub(:today){"2014-01-06".to_date}
113 | bill1 = FactoryGirl.build(:bill1)
114 | priority1 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today - 6)
115 | bill1.priorities = [priority1]
116 | bill1.save
117 | bill1.current_priority.should eq "Discusión inmediata"
118 |
119 | bill2 = FactoryGirl.build(:bill2)
120 | priority2 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today - 7)
121 | bill2.priorities = [priority2]
122 | bill2.save
123 | bill2.current_priority.should eq "Sin urgencia"
124 | end
125 | end
126 |
127 | describe "self.update_priority" do
128 | before(:each) do
129 | Date.stub(:today){"2014-01-06".to_date}
130 | @bill1 = FactoryGirl.build(:bill1)
131 | @bill2 = FactoryGirl.build(:bill2)
132 | priority1 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today - 6)
133 | priority2 = FactoryGirl.create(:priority1, type: "Discusión inmediata", entry_date: Date.today - 7)
134 | @bill1.priorities = [priority1]
135 | @bill2.priorities = [priority2]
136 | @bill1.save
137 | @bill2.save
138 | end
139 | it "updates outdated bill priorities for all bills" do
140 | # Day 1
141 | @bill1.current_priority.should eq "Discusión inmediata"
142 | @bill2.current_priority.should eq "Sin urgencia"
143 | # The next day
144 | Date.stub(:today){"2014-01-07".to_date}
145 | Bill.update_priority
146 | updated_bill1 = Bill.find_by uid: @bill1.uid
147 | updated_bill2 = Bill.find_by uid: @bill2.uid
148 | updated_bill1.current_priority.should eq "Sin urgencia"
149 | updated_bill2.current_priority.should eq "Sin urgencia"
150 | end
151 |
152 | it "indexes the updated bill priorities" do
153 | Bill.update_priority
154 |
155 | Sunspot.remove_all(Bill)
156 | Sunspot.index!(@bill1)
157 | Sunspot.index!(@bill2)
158 | search = Sunspot.search Bill do
159 | text_fields do
160 | with :current_priority, "Sin urgencia"
161 | end
162 | end
163 | search.results.count.should eq 1
164 | end
165 | end
166 | end
--------------------------------------------------------------------------------
/spec/models/count_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe Count do
4 | pending "add some examples to (or delete) #{__FILE__}"
5 | end
6 |
--------------------------------------------------------------------------------
/spec/models/motion_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe Motion do
4 | it "has a valid factory" do
5 | FactoryGirl.create(:motion).should be_valid
6 | end
7 |
8 | # it "is invalid without an uique id (uid)" do
9 | # FactoryGirl.build(:bill, uid: nil).should_not be_valid
10 | # end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/models/paperwork_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe Paperwork do
4 | it "saves a valid timeline_status" do
5 | @paperwork1 = FactoryGirl.build(:paperwork1)
6 | @paperwork2 = FactoryGirl.build(:paperwork2)
7 | @bill = FactoryGirl.create(:bill1)
8 | @bill.paperworks = [@paperwork1, @paperwork2]
9 | @bill.save
10 | @paperwork1.save
11 | @paperwork2.save
12 | @paperwork1.timeline_status.should eq 'Ingreso'
13 | @paperwork2.timeline_status.should eq 'Tramitación Terminada'
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/spec/models/vote_event_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe VoteEvent do
4 | pending "add some examples to (or delete) #{__FILE__}"
5 | end
6 |
--------------------------------------------------------------------------------
/spec/models/vote_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 |
3 | describe Vote do
4 | pending "add some examples to (or delete) #{__FILE__}"
5 | end
6 |
--------------------------------------------------------------------------------
/spec/routing/bills_routing_spec.rb:
--------------------------------------------------------------------------------
1 | require "spec_helper"
2 |
3 | describe BillsController do
4 | describe "routing" do
5 |
6 | it "routes to #index" do
7 | get("/bills").should route_to("bills#index")
8 | end
9 |
10 | it "routes to #new" do
11 | get("/bills/new").should route_to("bills#new")
12 | end
13 |
14 | it "routes to #show" do
15 | get("/bills/1").should route_to("bills#show", :id => "1")
16 | end
17 |
18 | it "routes to #edit" do
19 | get("/bills/1/edit").should route_to("bills#edit", :id => "1")
20 | end
21 |
22 | it "routes to #create" do
23 | post("/bills").should route_to("bills#create")
24 | end
25 |
26 | it "routes to #update" do
27 | put("/bills/1").should route_to("bills#update", :id => "1")
28 | end
29 |
30 | it "routes to #destroy" do
31 | delete("/bills/1").should route_to("bills#destroy", :id => "1")
32 | end
33 |
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # This file is copied to spec/ when you run 'rails generate rspec:install'
2 | ENV["RAILS_ENV"] ||= 'test'
3 | require File.expand_path("../../config/environment", __FILE__)
4 | require 'rspec/rails'
5 | require 'rspec/autorun'
6 | require 'webmock/rspec'
7 |
8 | # Requires supporting ruby files with custom matchers and macros, etc,
9 | # in spec/support/ and its subdirectories.
10 | Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
11 |
12 | # Enables localhost connections for solr indexing
13 | WebMock.disable_net_connect!(:allow_localhost => true)
14 |
15 | RSpec.configure do |config|
16 | # ## Mock Framework
17 | #
18 | # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
19 | #
20 | # config.mock_with :mocha
21 | # config.mock_with :flexmock
22 | # config.mock_with :rr
23 |
24 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
25 | # config.fixture_path = "#{::Rails.root}/spec/fixtures"
26 |
27 | # If you're not using ActiveRecord, or you'd prefer not to run each of your
28 | # examples within a transaction, remove the following line or assign false
29 | # instead of true.
30 | # config.use_transactional_fixtures = true
31 |
32 | # If true, the base class of anonymous controllers will be inferred
33 | # automatically. This will be the default behavior in future versions of
34 | # rspec-rails.
35 | config.infer_base_class_for_anonymous_controllers = false
36 |
37 | # Run specs in random order to surface order dependencies. If you find an
38 | # order dependency and want to debug it, you can fix the order by providing
39 | # the seed, which is printed after each run.
40 | # --seed 1234
41 | config.order = "random"
42 |
43 | # Database_cleaner
44 | config.before :each do
45 | DatabaseCleaner[:mongoid].strategy = :truncation
46 | DatabaseCleaner[:mongoid].start
47 | end
48 | config.after do
49 | DatabaseCleaner[:mongoid].clean
50 | end
51 |
52 | # To skip groups of tests
53 | config.filter_run_excluding :broken => true
54 |
55 | end
56 |
--------------------------------------------------------------------------------
/sunspot-solr.pid:
--------------------------------------------------------------------------------
1 | 10753
--------------------------------------------------------------------------------
/test/fixtures/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/test/fixtures/.gitkeep
--------------------------------------------------------------------------------
/test/functional/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/test/functional/.gitkeep
--------------------------------------------------------------------------------
/test/integration/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/test/integration/.gitkeep
--------------------------------------------------------------------------------
/test/performance/browsing_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 | require 'rails/performance_test_help'
3 |
4 | class BrowsingTest < ActionDispatch::PerformanceTest
5 | # Refer to the documentation for all available options
6 | # self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
7 | # :output => 'tmp/performance', :formats => [:flat] }
8 |
9 | def test_homepage
10 | get '/'
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] = "test"
2 | require File.expand_path('../../config/environment', __FILE__)
3 | require 'rails/test_help'
4 |
5 | class ActiveSupport::TestCase
6 | # Add more helper methods to be used by all tests here...
7 | end
8 |
--------------------------------------------------------------------------------
/test/unit/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/test/unit/.gitkeep
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/vendor/assets/javascripts/.gitkeep
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/vendor/assets/stylesheets/.gitkeep
--------------------------------------------------------------------------------
/vendor/plugins/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ciudadanointeligente/bill-it/25d9c6480d09dc7f0969f447b9f31a23acc18200/vendor/plugins/.gitkeep
--------------------------------------------------------------------------------