aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeLines
* Fix body/show view spec after rewordingGareth Rees2015-03-02-1/+1
|
* Fully prevent banned users editing their photoGareth Rees2015-02-24-0/+28
|
* Fully prevent banned users editing their about_meGareth Rees2015-02-24-0/+29
|
* Add specs to AboutMeValidatorGareth Rees2015-02-24-0/+53
|
* Add User#banned?Gareth Rees2015-02-24-0/+18
| | | | | | | - Redefined User#public_banned? to User#banned? - Add specs for User#banned? - Deprecate User#public_banned? - Replace use of User#public_banned? with User#banned?
* Merge branch '2134-fix-same-attribute-value-across-locales' into rails-3-developLouise Crow2015-02-23-4/+291
|\
| * Use before methods for object setup, model existing behaviour.Louise Crow2015-02-23-50/+16
| | | | | | | | | | Existing behaviour seems to be that when a tag is specified, only bodies that already have that tag will be updated.
| * Create bodies in before call.Louise Crow2015-02-23-19/+25
| |
| * Include tag_string from csv in tags expected.Louise Crow2015-02-23-2/+2
| | | | | | | | | | As I understand it, the expectation is to replace any existing tags with both the tag from the UI and the tags from the csv.
| * Comprehensive specs for CSV Import tag_string fieldGareth Rees2015-02-23-0/+297
| |
| * Give example csv file .csv extensionLouise Crow2015-02-23-2/+2
| |
| * Refactor massive import method into smaller instance level methodsLouise Crow2015-02-23-2/+2
| |
| * Test localised value for import against existing localised valueLouise Crow2015-02-23-0/+18
| | | | | | | | | | | | | | | | | | Previously the call to public_body.send would return the value for the default locale if no value was set in the current locale, meaning that translations for attributes that were the same as the attribute values in the default locale were not being loaded. Fixes #2134.
* | Refactor showing the Make Request buttonGareth Rees2015-02-20-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code here was hard to follow. Now we have a cleaner path to decide whether to show the Make Request button or not. - Always show any notes associated with the body - If a request can be made to the body - Show any tag-specific notes that may affect the request - Show the Make Request button - If a request cannot be made to the body - Show the most relevant reason why a request cannot be made Added PublicBodyHelper#public_body_not_requestable_reasons to extract the logic of finding the reason a user can’t request out of the template
* | Move logic to modelLouise Crow2015-02-20-10/+33
| |
* | Remove spec redundancy following code refactor.Louise Crow2015-02-20-30/+31
| |
* | Use correct method name in error.Louise Crow2015-02-20-1/+1
| |
* | Refactor common logicLouise Crow2015-02-20-6/+6
| |
* | Add some specs for current behaviourLouise Crow2015-02-20-0/+102
| |
* | Merge branch 'hotfix/0.20.0.11' into rails-3-developLouise Crow2015-02-13-2/+15
|\ \
| * | Set binary mode to false in call to pdftohtmlLouise Crow2015-02-13-2/+15
| | | | | | | | | | | | | | | We want the HTML to be encoding in the default encoding so that it can be combined with other strings.
| * | Merge branch 'hotfix/0.20.0.7'0.20.0.7Louise Crow2015-02-05-0/+6
| |\ \ | | | | | | | | | | | | | | | | Conflicts: config/initializers/alaveteli.rb
* | \ \ Merge branch 'issues/1680-changes-to-signin-signup-screen' into rails-3-developGareth Rees2015-02-05-1/+1
|\ \ \ \
| * | | | Design and wording changes to sign-in/sign-up screenMartin Wright2015-02-05-1/+1
| | | | |
* | | | | Use correct paths for Editing a Public Body specGareth Rees2015-02-05-5/+5
| | | | |
* | | | | Merge branch 'hotfix/0.20.0.7' into rails-3-developLouise Crow2015-02-05-0/+6
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | Conflicts: config/initializers/alaveteli.rb
| * | | | Do not allow requests for search results after the first 500Louise Crow2015-02-03-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pages for these search results are extremely slow to load. This is not an ideal solution by any means. Really we want to dig into why high offsets are so slow, and whether there's anything we can do to fix that.
* | | | | Merge branch 'hotfix/0.20.0.6' into rails-3-developLouise Crow2015-02-05-12/+311
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| | Conflicts: spec/models/public_body_spec.rb
| * | | Build available locales in the controllerGareth Rees2015-02-03-81/+32
| | | | | | | | | | | | | | | | | | | | Removes logic from views and obsoletes AdminPublicBodyHelper#public_body_form_object
| * | | Fix submission of form containing both existing and new translationsLouise Crow2015-02-03-74/+75
| | | |
| * | | Add AdminPublicBodyController#update specsGareth Rees2015-02-03-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Covers core functionality. Could do with extracting multiple assertions in to individual specs. Strange that you need to call `reload` on the PublicBody instance when testing “updates an existing translation and adds a third translation”
| * | | Add specs for PublicBody#translated_versions=Gareth Rees2015-01-30-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixes #empty_translation? to check for String and Symbol keys named 'locale'. Specs use a pre-change check to assert difference. For some reason rspec change matcher fails with 'nil is not a symbol'.
| * | | Extract view logicGareth Rees2015-01-30-0/+79
| | | |
| * | | Test adding multiple translations to Public BodiesGareth Rees2015-01-30-0/+56
| |/ /
* | | Use map instead of creating empty arrayGareth Rees2015-02-04-0/+12
| | |
* | | Nicer capitalize first letter onlyGareth Rees2015-02-04-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String#capitalize downcases remaining letters, so: > 'heLLo WorLd'.capitalize # => "Hello world" Our version only works on the first character of the String, preserving the case of the rest of the String: > 'heLLo WorLd'.sub(/\S/) { |m| Unicode.upcase(m) } # => 'HeLLo WorLd' Also handle unicode.
* | | Add PublicBody#type_of_authority specsGareth Rees2015-01-23-0/+87
| |/ |/|
* | Merge branch '2051-back-to-search' into rails-3-developGareth Rees2015-01-13-0/+45
|\ \
| * | Add a “Back to search results” linkGareth Rees2015-01-13-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store the search parameters in the flash when a search is made via the select_authority_path page. Stores the parameters for both POST and AJAX typeahead searches. The presence of stored search params renders the link on the PublicBodyController#show template. “keep”s the search params in PublicBodyController#show so that if the user clicks the browser’s back button the “Back to search results” link can still be rendered on the next search result they click. “keep”s all flash keys in ServicesController#other_country_message as it’s called through AJAX and ends up sweeping the flash. [1] [1] More details about this: http://mikenaberezny.com/2007/09/08/keep-the-flash-and-test-it-too/
* | | Merge branch '1682-just-made-a-request' into rails-3-developGareth Rees2015-01-13-3/+12
|\ \ \
| * | | Use a partial to render batch sent messageGareth Rees2015-01-13-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dropped the law_used_full interpolation: So I think there are two significant bits of context here. One is that the law_used_full attribute is derived from law_used, which in turn is set on InfoRequest initialisation based on the tags applied to the public body. So different requests in a batch could have different values for law_used_full - some of them might be to bodies that only accept environmental information requests. So using the value from the batch template is not really a good proxy for the whole collection. The second is that, in any case, the distinction between the two types of request is a UK-specific feature which should be moved to the UK theme (#2085). Given these two factors, I think the cleanest thing might be to drop law_used_full from this descriptive text, and just have it say "Your requests will be sent shortly", without specifying what law will be used. – Louise Crow (@crowbot)
| * | | Use a partial to render request sent messageGareth Rees2015-01-13-0/+10
| |/ /
* | | Merge branch '1680-sign-up-form' into rails-3-developGareth Rees2015-01-09-8/+9
|\ \ \ | |/ / |/| |
| * | Scope AlaveteliDsl#login fields within signup_formGareth Rees2015-01-06-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | Fills in the first “Your e-mail:” field it finds, which could be the sign _up_ form if the view is overridden to swap the order of the sign in and sign up forms. Also compacts a simple conditional on to one line.
* | | Merge branch 'hotfix/0.20.0.2' into rails-3-developLouise Crow2015-01-07-1/+45
|\ \ \ | | |/ | |/|
| * | Sanitize the blog contents0.20.0.2Louise Crow2014-12-22-1/+13
| | |
| * | Sanitize the contents of HTML attachments before displayLouise Crow2014-12-22-0/+32
| | |
* | | Fix assumption of current year as 2014 in holiday import specsLouise Crow2015-01-05-3/+5
| | |
* | | Update table attribute metadataLouise Crow2014-12-23-13/+8
| | | | | | | | | | | | | | | Some fields have moved to different models, or exist in translation tables.
* | | Remove focus tagLouise Crow2014-12-23-1/+1
| | |