remarkable_rails 3.1.9 → 3.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +0,0 @@
1
- # Create an application controller to satisfy rspec-rails, a dummy controller
2
- # and define routes.
3
- #
4
- class ApplicationController < ActionController::Base
5
- end
6
-
7
- class Task; end
8
-
9
- # Define routes
10
- ActionController::Routing::Routes.draw do |map|
11
- map.resources :projects, :has_many => :tasks
12
- map.connect ':controller/:action/:id'
13
- map.connect ':controller/:action/:id.:format'
14
- end
15
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,39 +0,0 @@
1
- class TasksController < ApplicationController
2
- filter_parameter_logging :password
3
-
4
- def index
5
- @tasks = Task.find(:all)
6
- render :text => 'index'
7
- end
8
-
9
- def new
10
- render :nothing => true
11
- end
12
-
13
- def show
14
- @task = Task.find(params[:id])
15
-
16
- # Multiple expects
17
- Task.count
18
- Task.max
19
- Task.min
20
-
21
- respond_to do |format|
22
- format.html { render :text => 'show' }
23
- format.xml { render :xml => @task.to_xml }
24
- end
25
- end
26
-
27
- def destroy
28
- @task = Task.find(params[:id])
29
- @task.destroy
30
-
31
- flash[:notice] = "#{@task.title(false).inspect} was removed"
32
- session[:last_task_id] = 37
33
-
34
- respond_to do |format|
35
- format.html { redirect_to project_tasks_url(10) }
36
- format.xml { head :ok }
37
- end
38
- end
39
- end
@@ -1,2 +0,0 @@
1
- en:
2
- my_plugin_locale: "My plugin locale"
@@ -1,4 +0,0 @@
1
- module MyPlugin
2
- module Matchers
3
- end
4
- end
@@ -1,92 +0,0 @@
1
- # This is based on Shoulda model builder for Test::Unit.
2
- #
3
- module FunctionalBuilder
4
- def self.included(base)
5
- base.class_eval do
6
- return unless base.name =~ /^Spec/
7
-
8
- base.controller_name 'application'
9
- base.integrate_views false
10
-
11
- after(:each) do
12
- if @defined_constants
13
- @defined_constants.each do |class_name|
14
- Object.send(:remove_const, class_name)
15
- end
16
- end
17
- end
18
- end
19
-
20
- base.extend ClassMethods
21
- end
22
-
23
- def build_response(&block)
24
- klass = defined?(ExamplesController) ? ExamplesController : define_controller('Examples')
25
- block ||= lambda { render :nothing => true }
26
- klass.class_eval { define_method(:example, &block) }
27
-
28
- @controller = klass.new
29
- @request = ActionController::TestRequest.new
30
- @response = ActionController::TestResponse.new
31
- get :example
32
-
33
- self.class.subject { @controller }
34
- end
35
-
36
- def define_controller(class_name, &block)
37
- class_name = class_name.to_s
38
- class_name << 'Controller' unless class_name =~ /Controller$/
39
- define_constant(class_name, ApplicationController, &block)
40
- end
41
-
42
- def define_constant(class_name, base, &block)
43
- class_name = class_name.to_s.camelize
44
-
45
- klass = Class.new(base)
46
- Object.const_set(class_name, klass)
47
-
48
- klass.class_eval(&block) if block_given?
49
-
50
- @defined_constants ||= []
51
- @defined_constants << class_name
52
-
53
- klass
54
- end
55
-
56
- module ClassMethods
57
- def generate_macro_stubs_specs_for(matcher, *args)
58
- expectation_args = args.dup
59
- options = args.extract_options!
60
- stub_args = (args << options.merge(:with_stubs => true))
61
-
62
- describe 'macro stubs' do
63
- before(:each) do
64
- @controller = TasksController.new
65
- @request = ActionController::TestRequest.new
66
- @response = ActionController::TestResponse.new
67
- end
68
-
69
- expects :new, :on => String, :with => 'ola', :returns => 'ola'
70
- get :new
71
-
72
- it 'should run expectations by default' do
73
- String.should_receive(:should_receive).with(:new).and_return(@mock=mock('chain'))
74
- @mock.should_receive(:with).with('ola').and_return(@mock)
75
- @mock.should_receive(:exactly).with(1).and_return(@mock)
76
- @mock.should_receive(:times).and_return(@mock)
77
- @mock.should_receive(:and_return).with('ola').and_return('ola')
78
-
79
- send(matcher, *expectation_args).matches?(@controller)
80
- end
81
-
82
- it 'should run stubs' do
83
- String.should_receive(:stub!).with(:new).and_return(@mock=mock('chain'))
84
- @mock.should_receive(:and_return).with('ola').and_return('ola')
85
-
86
- send(matcher, *stub_args).matches?(@controller)
87
- end
88
- end
89
-
90
- end
91
- end
92
- end
data/spec/rcov.opts DELETED
@@ -1,2 +0,0 @@
1
- --exclude "spec/*,gems/*"
2
- --rails
@@ -1,11 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe 'loader' do
4
- it "should load files in the plugin folder" do
5
- defined?(MyPlugin::Matchers).should == "constant"
6
- end
7
-
8
- it "should load files in the plugin folder" do
9
- I18n.t("my_plugin_locale").should == "My plugin locale"
10
- end
11
- end
data/spec/spec.opts DELETED
@@ -1,4 +0,0 @@
1
- --colour
2
- --format progress
3
- --loadby mtime
4
- --reverse
data/spec/spec_helper.rb DELETED
@@ -1,46 +0,0 @@
1
- require 'rubygems'
2
-
3
- RAILS_ENV = 'test'
4
- RAILS_VERSION = ENV['RAILS_VERSION'] || '2.3.3'
5
-
6
- # Load Rails
7
- gem 'activesupport', RAILS_VERSION
8
- require 'active_support'
9
-
10
- gem 'actionpack', RAILS_VERSION
11
- require 'action_controller'
12
-
13
- gem 'actionmailer', RAILS_VERSION
14
- require 'action_mailer'
15
-
16
- gem 'rails', RAILS_VERSION
17
- require 'rails/version'
18
-
19
- # Load Remarkable core on place to avoid gem to be loaded
20
- dir = File.dirname(__FILE__)
21
- require File.join(dir, '..', '..', 'remarkable', 'lib', 'remarkable')
22
-
23
- # Add spec/application to load path and set view_paths
24
- RAILS_ROOT = File.join(dir, 'application')
25
- $:.unshift(RAILS_ROOT)
26
-
27
- ActionController::Base.view_paths = RAILS_ROOT
28
- require File.join(RAILS_ROOT, 'application')
29
- require File.join(RAILS_ROOT, 'tasks_controller')
30
-
31
- # Load Remarkable Rails
32
- require File.join(dir, 'functional_builder')
33
-
34
- # Load spec-rails
35
- if ENV['RSPEC_VERSION']
36
- gem 'rspec-rails', ENV['RSPEC_VERSION']
37
- else
38
- gem 'rspec-rails'
39
- end
40
- require 'spec/rails'
41
-
42
- require File.join(dir, '..', 'lib', 'remarkable_rails')
43
-
44
- # Register folders to example groups
45
- Spec::Example::ExampleGroupFactory.register(:action_controller, Spec::Rails::Example::ControllerExampleGroup)
46
-