Skip to content
Newer
Older
100644 315 lines (269 sloc) 12.7 KB
0a59e0c @yabawock Always use # encoding: utf-8 declaration
yabawock authored Sep 27, 2010
1 # encoding: utf-8
281dd18 @xaviershay rspec support - test_helper and rake task
xaviershay authored Jul 5, 2008
2 require 'rubygems'
249dba1 @lardawge Add bundler for easier development setup
lardawge authored Nov 18, 2010
3 require 'bundler'
4 Bundler.setup
5
9604949 @justinfrench smart_require is tripping up the CI build, and also tripped me up a f…
authored Feb 7, 2010
6 require 'active_support'
7 require 'action_pack'
8 require 'action_view'
9 require 'action_controller'
26b0ba4 @asanghi make spec pass on rails3
asanghi authored Sep 29, 2010
10 #require 'action_mailer'
542d308 @grimen Fixing some issues with the specs to get them to run on Ruby 1.9.x. S…
grimen authored Sep 1, 2009
11
fe63045 @yabawock Use HTML safe strings in tests
yabawock authored May 24, 2010
12 require File.expand_path(File.join(File.dirname(__FILE__), '../lib/formtastic/util'))
b86266e @yabawock Separate test environment setup and misc setup blocks into spec/suppo…
yabawock authored Jun 17, 2010
13 require File.expand_path(File.join(File.dirname(__FILE__), '../lib/formtastic'))
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
14
b86266e @yabawock Separate test environment setup and misc setup blocks into spec/suppo…
yabawock authored Jun 17, 2010
15 # Requires supporting files with custom matchers and macros, etc,
2c68cd3 @huerlisi Sort list of files to require in spec helper.
huerlisi authored Jun 29, 2010
16 # in ./support/ and its subdirectories in alphabetic order.
17 Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each {|f| require f}
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
18
19 module FormtasticSpecHelper
82f6c8d @justinfrench Fixes deprecation warnings with form_for(:name, @resource) in rails3 (#…
authored Apr 20, 2010
20 include ActionPack
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
21 include ActionView::Context if defined?(ActionView::Context)
229eb53 @yabawock Make testsuite work with Rails 3.0.0.rc and RSpec 2.0.0.beta19
yabawock authored Jul 30, 2010
22 include ActionController::RecordIdentifier
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
23 include ActionView::Helpers::FormHelper
24 include ActionView::Helpers::FormTagHelper
25 include ActionView::Helpers::FormOptionsHelper
26 include ActionView::Helpers::UrlHelper
27 include ActionView::Helpers::TagHelper
28 include ActionView::Helpers::TextHelper
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
29 include ActionView::Helpers::ActiveRecordHelper if defined?(ActionView::Helpers::ActiveRecordHelper)
30 include ActionView::Helpers::ActiveModelHelper if defined?(ActionView::Helpers::ActiveModelHelper)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
31 include ActionView::Helpers::DateHelper
32 include ActionView::Helpers::CaptureHelper
127a6b9 @justinfrench Added a Formtastic::LayoutHelper with formtastic_stylesheets so that …
authored Jan 10, 2010
33 include ActionView::Helpers::AssetTagHelper
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
34 include ActiveSupport
229eb53 @yabawock Make testsuite work with Rails 3.0.0.rc and RSpec 2.0.0.beta19
yabawock authored Jul 30, 2010
35 include ActionController::PolymorphicRoutes if defined?(ActionController::PolymorphicRoutes)
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
36
549ef7a @justinfrench Renamed all instances of Formtastic::SemanticFormBuilder to Formtasti…
authored Jan 18, 2011
37 include Formtastic::Helpers::FormHelper
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
38
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
39 def default_input_type(column_type, column_name = :generic_column_name)
40 @new_post.stub!(column_name)
41 @new_post.stub!(:column_for_attribute).and_return(mock('column', :type => column_type)) unless column_type.nil?
42
43 semantic_form_for(@new_post) do |builder|
44 @default_type = builder.send(:default_input_type, column_name)
45 end
46
47 return @default_type
48 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
49
98ceff5 @koppen Automatically set maxlength if object is an ActiveModel and the field…
koppen authored Aug 27, 2010
50 def active_model_validator(kind, attributes, options = {})
51 validator = mock("ActiveModel::Validations::#{kind.to_s.titlecase}Validator", :attributes => attributes, :options => options)
52 validator.stub!(:kind).and_return(kind)
53 validator
54 end
55
2769784 @tetsuo692 add active_model_presence_validator helper and clean up test
tetsuo692 authored Apr 21, 2010
56 def active_model_presence_validator(attributes, options = {})
98ceff5 @koppen Automatically set maxlength if object is an ActiveModel and the field…
koppen authored Aug 27, 2010
57 active_model_validator(:presence, attributes, options)
2769784 @tetsuo692 add active_model_presence_validator helper and clean up test
tetsuo692 authored Apr 20, 2010
58 end
98ceff5 @koppen Automatically set maxlength if object is an ActiveModel and the field…
koppen authored Aug 27, 2010
59
60 def active_model_length_validator(attributes, options = {})
61 active_model_validator(:length, attributes, options)
62 end
63
e38a068 @sobrinho Spec for last commit
sobrinho authored Sep 30, 2010
64 def active_model_inclusion_validator(attributes, options = {})
65 active_model_validator(:inclusion, attributes, options)
d6e6265 @justinfrench NumericInput now provides default min, max and step attributes by ref…
authored Apr 5, 2011
66 end
67
68 def active_model_numericality_validator(attributes, options = {})
69 active_model_validator(:numericality, attributes, options)
e38a068 @sobrinho Spec for last commit
sobrinho authored Oct 1, 2010
70 end
71
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
72 class ::Post
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
73 extend ActiveModel::Naming if defined?(ActiveModel::Naming)
74 include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
75
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
76 def id
77 end
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
78
79 def persisted?
80 end
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
81 end
d33fad4 @akaspick Fix incorrect html class name being generated for namespaced objects.
akaspick authored Dec 30, 2009
82 module ::Namespaced
83 class Post
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
84 extend ActiveModel::Naming if defined?(ActiveModel::Naming)
85 include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
86
d33fad4 @akaspick Fix incorrect html class name being generated for namespaced objects.
akaspick authored Dec 30, 2009
87 def id
88 end
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
89
90 def persisted?
91 end
d33fad4 @akaspick Fix incorrect html class name being generated for namespaced objects.
akaspick authored Dec 30, 2009
92 end
93 end
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
94 class ::Author
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
95 extend ActiveModel::Naming if defined?(ActiveModel::Naming)
96 include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
97
33a5d23 Added :group_by option to select input (issue #54)
Jeroen van Dijk authored Nov 11, 2009
98 def to_label
99 end
100 end
101 class ::Continent
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
102 extend ActiveModel::Naming if defined?(ActiveModel::Naming)
103 include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
104 end
506182b @yabawock Make ActiveModel Tests work without relying on RSpec unstub!
yabawock authored Jun 18, 2010
105 class ::PostModel
106 extend ActiveModel::Naming if defined?(ActiveModel::Naming)
107 include ActiveModel::Conversion if defined?(ActiveModel::Conversion)
108 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
109
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
110 def mock_everything
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
111
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
112 # Resource-oriented styles like form_for(@post) will expect a path method for the object,
113 # so we're defining some here.
506182b @yabawock Make ActiveModel Tests work without relying on RSpec unstub!
yabawock authored Jun 18, 2010
114 def post_models_path; "/postmodels/1"; end
115
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
116 def post_path(o); "/posts/1"; end
117 def posts_path; "/posts"; end
118 def new_post_path; "/posts/new"; end
119
120 def author_path(o); "/authors/1"; end
121 def authors_path; "/authors"; end
122 def new_author_path; "/authors/new"; end
4fcd1e8 @lardawge Use real object to get specs passing in ruby 192
lardawge authored Nov 26, 2010
123
124 @fred = ::Author.new
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
125 @fred.stub!(:class).and_return(::Author)
126 @fred.stub!(:to_label).and_return('Fred Smith')
127 @fred.stub!(:login).and_return('fred_smith')
5733f7b @farnoy Tests for RangeInput and minor code refactoring. New column for Author
farnoy authored Feb 1, 2011
128 @fred.stub!(:age).and_return(27)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
129 @fred.stub!(:id).and_return(37)
130 @fred.stub!(:new_record?).and_return(false)
131 @fred.stub!(:errors).and_return(mock('errors', :[] => nil))
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
132 @fred.stub!(:to_key).and_return(nil)
133 @fred.stub!(:persisted?).and_return(nil)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
134
4fcd1e8 @lardawge Use real object to get specs passing in ruby 192
lardawge authored Nov 25, 2010
135 @bob = ::Author.new
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
136 @bob.stub!(:to_label).and_return('Bob Rock')
137 @bob.stub!(:login).and_return('bob')
5733f7b @farnoy Tests for RangeInput and minor code refactoring. New column for Author
farnoy authored Feb 1, 2011
138 @bob.stub!(:age).and_return(43)
b326984 @justinfrench trying to move as much set up as possible into mock_everything
authored Nov 12, 2009
139 @bob.stub!(:created_at)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
140 @bob.stub!(:id).and_return(42)
141 @bob.stub!(:posts).and_return([])
142 @bob.stub!(:post_ids).and_return([])
143 @bob.stub!(:new_record?).and_return(false)
144 @bob.stub!(:errors).and_return(mock('errors', :[] => nil))
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
145 @bob.stub!(:to_key).and_return(nil)
146 @bob.stub!(:persisted?).and_return(nil)
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
147
4fcd1e8 @lardawge Use real object to get specs passing in ruby 192
lardawge authored Nov 25, 2010
148 @james = ::Author.new
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
149 @james.stub!(:to_label).and_return('James Shock')
150 @james.stub!(:login).and_return('james')
5733f7b @farnoy Tests for RangeInput and minor code refactoring. New column for Author
farnoy authored Feb 1, 2011
151 @james.stub!(:age).and_return(38)
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
152 @james.stub!(:id).and_return(75)
153 @james.stub!(:posts).and_return([])
154 @james.stub!(:post_ids).and_return([])
155 @james.stub!(:new_record?).and_return(false)
156 @james.stub!(:errors).and_return(mock('errors', :[] => nil))
157 @james.stub!(:to_key).and_return(nil)
158 @james.stub!(:persisted?).and_return(nil)
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
159
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
160
161 ::Author.stub!(:find).and_return([@fred, @bob])
2f27975 @yabawock Fix testsuite to match use of :all.
yabawock authored Aug 7, 2010
162 ::Author.stub!(:all).and_return([@fred, @bob])
4134c12 @justinfrench fix a bunch of issues and failing select input specs around #where vs…
authored Mar 16, 2011
163 ::Author.stub!(:where).and_return([@fred, @bob])
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
164 ::Author.stub!(:human_attribute_name).and_return { |column_name| column_name.humanize }
165 ::Author.stub!(:human_name).and_return('::Author')
166 ::Author.stub!(:reflect_on_association).and_return { |column_name| mock('reflection', :options => {}, :klass => Post, :macro => :has_many) if column_name == :posts }
17f6668 @justinfrench Revert "This reverts commit 440bd2d."
authored Nov 21, 2009
167 ::Author.stub!(:content_columns).and_return([mock('column', :name => 'login'), mock('column', :name => 'created_at')])
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
168 ::Author.stub!(:to_key).and_return(nil)
169 ::Author.stub!(:persisted?).and_return(nil)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
170
171 # Sometimes we need a mock @post object and some Authors for belongs_to
172 @new_post = mock('post')
173 @new_post.stub!(:class).and_return(::Post)
174 @new_post.stub!(:id).and_return(nil)
175 @new_post.stub!(:new_record?).and_return(true)
176 @new_post.stub!(:errors).and_return(mock('errors', :[] => nil))
177 @new_post.stub!(:author).and_return(nil)
2814011 @yabawock Merge branch 'master' into rails3
yabawock authored May 4, 2010
178 @new_post.stub!(:reviewer).and_return(nil)
9c1daba Added regression spec for a belongs_to association with :group_by => …
Jacob Kjeldahl authored Nov 25, 2009
179 @new_post.stub!(:main_post).and_return(nil)
180 @new_post.stub!(:sub_posts).and_return([]) #TODO should be a mock with methods for adding sub posts
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
181 @new_post.stub!(:to_key).and_return(nil)
182 @new_post.stub!(:to_model).and_return(@new_post)
183 @new_post.stub!(:persisted?).and_return(nil)
6edfbfb @twalpole verify value is taken from object
twalpole authored May 2, 2011
184
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
185 @freds_post = mock('post')
4fcd1e8 @lardawge Use real object to get specs passing in ruby 192
lardawge authored Nov 25, 2010
186 @freds_post.stub!(:to_ary)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
187 @freds_post.stub!(:class).and_return(::Post)
188 @freds_post.stub!(:to_label).and_return('Fred Smith')
189 @freds_post.stub!(:id).and_return(19)
03ef4a1 @justinfrench Spec coverage to confirm that a work-around exists for GH-398.
authored Oct 17, 2010
190 @freds_post.stub!(:title).and_return("Hello World")
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
191 @freds_post.stub!(:author).and_return(@fred)
192 @freds_post.stub!(:author_id).and_return(@fred.id)
193 @freds_post.stub!(:authors).and_return([@fred])
194 @freds_post.stub!(:author_ids).and_return([@fred.id])
195 @freds_post.stub!(:new_record?).and_return(false)
196 @freds_post.stub!(:errors).and_return(mock('errors', :[] => nil))
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
197 @freds_post.stub!(:to_key).and_return(nil)
198 @freds_post.stub!(:persisted?).and_return(nil)
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
199 @fred.stub!(:posts).and_return([@freds_post])
200 @fred.stub!(:post_ids).and_return([@freds_post.id])
201
202 ::Post.stub!(:human_attribute_name).and_return { |column_name| column_name.humanize }
203 ::Post.stub!(:human_name).and_return('Post')
204 ::Post.stub!(:reflect_on_all_validations).and_return([])
506182b @yabawock Make ActiveModel Tests work without relying on RSpec unstub!
yabawock authored Jun 18, 2010
205 ::Post.stub!(:reflect_on_validations_for).and_return([])
1bd9545 @justinfrench belongs_to associations will now render errors attached to the associ…
authored Apr 21, 2010
206 ::Post.stub!(:reflections).and_return({})
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
207 ::Post.stub!(:reflect_on_association).and_return do |column_name|
208 case column_name
209 when :author, :author_status
33a5d23 Added :group_by option to select input (issue #54)
Jeroen van Dijk authored Nov 11, 2009
210 mock = mock('reflection', :options => {}, :klass => ::Author, :macro => :belongs_to)
211 mock.stub!(:[]).with(:class_name).and_return("Author")
212 mock
2814011 @yabawock Merge branch 'master' into rails3
yabawock authored May 4, 2010
213 when :reviewer
214 mock = mock('reflection', :options => {:class_name => 'Author'}, :klass => ::Author, :macro => :belongs_to)
74eaf33 @gpetrica added test case for model that has 2 belongs_to fields pointing to sa…
gpetrica authored Apr 26, 2010
215 mock.stub!(:[]).with(:class_name).and_return("Author")
216 mock
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
217 when :authors
218 mock('reflection', :options => {}, :klass => ::Author, :macro => :has_and_belongs_to_many)
9c1daba Added regression spec for a belongs_to association with :group_by => …
Jacob Kjeldahl authored Nov 25, 2009
219 when :sub_posts
220 mock('reflection', :options => {}, :klass => ::Post, :macro => :has_many)
221 when :main_post
222 mock('reflection', :options => {}, :klass => ::Post, :macro => :belongs_to)
fb643c7 spec for mongoid references fix
smix authored Feb 2, 2011
223 when :mongoid_reviewer
7b751af @justinfrench change mongoid select spec to use a foreign key for which the model a…
authored Mar 17, 2011
224 mock('reflection', :options => {}, :klass => ::Author, :macro => :referenced_in, :foreign_key => "reviewer_id") # custom id
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
225 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
226
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
227 end
228 ::Post.stub!(:find).and_return([@freds_post])
2f27975 @yabawock Fix testsuite to match use of :all.
yabawock authored Aug 7, 2010
229 ::Post.stub!(:all).and_return([@freds_post])
4134c12 @justinfrench fix a bunch of issues and failing select input specs around #where vs…
authored Mar 16, 2011
230 ::Post.stub!(:where).and_return([@freds_post])
17f6668 @justinfrench Revert "This reverts commit 440bd2d."
authored Nov 21, 2009
231 ::Post.stub!(:content_columns).and_return([mock('column', :name => 'title'), mock('column', :name => 'body'), mock('column', :name => 'created_at')])
b88bd5b @yabawock Changed spec_helper to allow for Rails 3 / Rspec 2 environment
yabawock authored Apr 15, 2010
232 ::Post.stub!(:to_key).and_return(nil)
233 ::Post.stub!(:persisted?).and_return(nil)
4fcd1e8 @lardawge Use real object to get specs passing in ruby 192
lardawge authored Nov 25, 2010
234 ::Post.stub!(:to_ary)
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
235
deb9f9b @asanghi automatic deduction of errors related to file type fields
asanghi authored Oct 28, 2010
236 @mock_file = mock('file')
549ef7a @justinfrench Renamed all instances of Formtastic::SemanticFormBuilder to Formtasti…
authored Jan 18, 2011
237 Formtastic::FormBuilder.file_methods.each do |method|
deb9f9b @asanghi automatic deduction of errors related to file type fields
asanghi authored Oct 28, 2010
238 @mock_file.stub!(method).and_return(true)
239 end
240
7466c77 @justinfrench moved the #inputs and #input specs out to their own file, and moved m…
authored Oct 22, 2009
241 @new_post.stub!(:title)
f8e4100 @asanghi string type html defaults for newer fields
asanghi authored Sep 29, 2010
242 @new_post.stub!(:email)
243 @new_post.stub!(:url)
244 @new_post.stub!(:phone)
245 @new_post.stub!(:search)
4fcd1e8 @lardawge Use real object to get specs passing in ruby 192
lardawge authored Nov 25, 2010
246 @new_post.stub!(:to_ary)
7466c77 @justinfrench moved the #inputs and #input specs out to their own file, and moved m…
authored Oct 22, 2009
247 @new_post.stub!(:body)
248 @new_post.stub!(:published)
b326984 @justinfrench trying to move as much set up as possible into mock_everything
authored Nov 12, 2009
249 @new_post.stub!(:publish_at)
17f6668 @justinfrench Revert "This reverts commit 440bd2d."
authored Nov 21, 2009
250 @new_post.stub!(:created_at)
6edfbfb @twalpole verify value is taken from object
twalpole authored May 3, 2011
251 @new_post.stub!(:secret).and_return(1)
e0a7874 @asanghi Added auto-guessing and updated some docs
asanghi authored Oct 10, 2010
252 @new_post.stub!(:url)
253 @new_post.stub!(:email)
254 @new_post.stub!(:search)
255 @new_post.stub!(:phone)
b326984 @justinfrench trying to move as much set up as possible into mock_everything
authored Nov 12, 2009
256 @new_post.stub!(:time_zone)
257 @new_post.stub!(:category_name)
77ae6ad @lardawge [Fix] Input boolean checked values do not reflect database values
lardawge authored Nov 14, 2010
258 @new_post.stub!(:allow_comments).and_return(true)
8f75fc7 @lardawge input_html should be passed to checkbox_tag
lardawge authored Nov 23, 2010
259 @new_post.stub!(:answer_comments)
3ae6b20 @justinfrench An input without an :as option will only route to country_input if th…
authored May 4, 2010
260 @new_post.stub!(:country)
261 @new_post.stub!(:country_subdivision)
262 @new_post.stub!(:country_code)
deb9f9b @asanghi automatic deduction of errors related to file type fields
asanghi authored Oct 28, 2010
263 @new_post.stub!(:document).and_return(@mock_file)
7466c77 @justinfrench moved the #inputs and #input specs out to their own file, and moved m…
authored Oct 22, 2009
264 @new_post.stub!(:column_for_attribute).with(:meta_description).and_return(mock('column', :type => :string, :limit => 255))
b326984 @justinfrench trying to move as much set up as possible into mock_everything
authored Nov 12, 2009
265 @new_post.stub!(:column_for_attribute).with(:title).and_return(mock('column', :type => :string, :limit => 50))
7466c77 @justinfrench moved the #inputs and #input specs out to their own file, and moved m…
authored Oct 22, 2009
266 @new_post.stub!(:column_for_attribute).with(:body).and_return(mock('column', :type => :text))
267 @new_post.stub!(:column_for_attribute).with(:published).and_return(mock('column', :type => :boolean))
b326984 @justinfrench trying to move as much set up as possible into mock_everything
authored Nov 12, 2009
268 @new_post.stub!(:column_for_attribute).with(:publish_at).and_return(mock('column', :type => :date))
269 @new_post.stub!(:column_for_attribute).with(:time_zone).and_return(mock('column', :type => :string))
270 @new_post.stub!(:column_for_attribute).with(:allow_comments).and_return(mock('column', :type => :boolean))
1bd9545 @justinfrench belongs_to associations will now render errors attached to the associ…
authored Apr 20, 2010
271 @new_post.stub!(:column_for_attribute).with(:author).and_return(mock('column', :type => :integer))
3ae6b20 @justinfrench An input without an :as option will only route to country_input if th…
authored May 3, 2010
272 @new_post.stub!(:column_for_attribute).with(:country).and_return(mock('column', :type => :string, :limit => 255))
273 @new_post.stub!(:column_for_attribute).with(:country_subdivision).and_return(mock('column', :type => :string, :limit => 255))
274 @new_post.stub!(:column_for_attribute).with(:country_code).and_return(mock('column', :type => :string, :limit => 255))
e0a7874 @asanghi Added auto-guessing and updated some docs
asanghi authored Oct 10, 2010
275 @new_post.stub!(:column_for_attribute).with(:email).and_return(mock('column', :type => :string, :limit => 255))
276 @new_post.stub!(:column_for_attribute).with(:url).and_return(mock('column', :type => :string, :limit => 255))
277 @new_post.stub!(:column_for_attribute).with(:phone).and_return(mock('column', :type => :string, :limit => 255))
278 @new_post.stub!(:column_for_attribute).with(:search).and_return(mock('column', :type => :string, :limit => 255))
deb9f9b @asanghi automatic deduction of errors related to file type fields
asanghi authored Oct 28, 2010
279 @new_post.stub!(:column_for_attribute).with(:document).and_return(nil)
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
280
b326984 @justinfrench trying to move as much set up as possible into mock_everything
authored Nov 12, 2009
281 @new_post.stub!(:author).and_return(@bob)
282 @new_post.stub!(:author_id).and_return(@bob.id)
9c1daba Added regression spec for a belongs_to association with :group_by => …
Jacob Kjeldahl authored Nov 25, 2009
283
2814011 @yabawock Merge branch 'master' into rails3
yabawock authored May 4, 2010
284 @new_post.stub!(:reviewer).and_return(@fred)
285 @new_post.stub!(:reviewer_id).and_return(@fred.id)
a745de3 @gpetrica test case
gpetrica authored Apr 26, 2010
286
c453c36 @grimen Failing spec and a "for some reason a non-working solution" for issue #…
grimen authored Nov 24, 2009
287 @new_post.should_receive(:publish_at=).any_number_of_times
288 @new_post.should_receive(:title=).any_number_of_times
9c1daba Added regression spec for a belongs_to association with :group_by => …
Jacob Kjeldahl authored Nov 25, 2009
289 @new_post.stub!(:main_post_id).and_return(nil)
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
290
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
291 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
292
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
293 def self.included(base)
294 base.class_eval do
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
295
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
296 attr_accessor :output_buffer
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
297
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
298 def protect_against_forgery?
299 false
300 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
301
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
302 end
303 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
304
ffa9e37 @justinfrench Added a with_config method for specs.
authored Dec 3, 2009
305 def with_config(config_method_name, value, &block)
549ef7a @justinfrench Renamed all instances of Formtastic::SemanticFormBuilder to Formtasti…
authored Jan 18, 2011
306 old_value = Formtastic::FormBuilder.send(config_method_name)
307 Formtastic::FormBuilder.send(:"#{config_method_name}=", value)
ffa9e37 @justinfrench Added a with_config method for specs.
authored Dec 2, 2009
308 yield
549ef7a @justinfrench Renamed all instances of Formtastic::SemanticFormBuilder to Formtasti…
authored Jan 18, 2011
309 Formtastic::FormBuilder.send(:"#{config_method_name}=", old_value)
ffa9e37 @justinfrench Added a with_config method for specs.
authored Dec 2, 2009
310 end
433dae2 @yabawock Whitespace Cleanup
yabawock authored Sep 27, 2010
311
9690e9b @justinfrench Start of The Big Spec Refactor:
authored Oct 21, 2009
312 end
313
39a5079 @justinfrench ensure that deprecation errors are always shown in specs... if you wa…
authored Nov 16, 2009
314 ::ActiveSupport::Deprecation.silenced = false
Something went wrong with that request. Please try again.