Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2009 Bytes
1 | module Spec |
2 | module Rails |
3 | module Matchers |
4 | |
5 | class RenderFormErrors |
6 | def initialize(error_fields, example) |
7 | @error_fields, @example = error_fields, example |
8 | end |
9 | |
10 | def matches?(response) |
11 | begin |
12 | response.should @example.have_tag('#error') |
13 | rescue |
14 | @display_failure_message = 'Expected to display form errors but did not' |
15 | end |
16 | |
17 | unless @display_failure_message |
18 | @error_fields.to_fields.each do |field_name, error_message| |
19 | begin |
20 | @example.assert_tag( |
21 | :tag => 'div', |
22 | :attributes => {:class => 'error-with-field'}, |
23 | :child => { |
24 | :tag => /input|select|textarea/, |
25 | :attributes => {:name => field_name} |
26 | }, |
27 | :child => { |
28 | :tag => 'span', |
29 | :attributes => {:class => 'error'}, |
30 | :content => error_message |
31 | } |
32 | ) |
33 | rescue |
34 | @error_field_failure_message = "Expected field #{field_name} to have error message '#{error_message}' but did not" |
35 | break |
36 | end |
37 | end |
38 | end |
39 | |
40 | @display_failure_message.nil? && @error_field_failure_message.nil? |
41 | end |
42 | |
43 | def failure_message |
44 | @display_failure_message ? @display_failure_message : @error_field_failure_message |
45 | end |
46 | |
47 | def negative_failure_message |
48 | 'Expected not to display form errors but did' |
49 | end |
50 | end |
51 | |
52 | # Used to ensure that there are model errors shown on the page. |
53 | # |
54 | # Looks to see if the response includes content according to the |
55 | # application's technique for displaying form errors. |
56 | def render_form_errors(error_fields = {}) |
57 | RenderFormErrors.new(error_fields, self) |
58 | end |
59 | |
60 | end |
61 | end |
62 | end |