aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
Commit message (Collapse)AuthorAgeLines
* Filter public body tracks by event typeRobin Houston2012-05-04-0/+29
| | | | | Add the facility to filter the public body feed by event type using a query string parameter, e.g. event_type=sent.
* Fix the "log in as" functionRobin Houston2012-03-20-8/+2
| | | | | | | | | | | | | | | Previously the "log in as" function after 3b6e5a692b852a88f55b21a7210f60a6f7cfc24b would attempt to log the admin user out before issuing the redirect. Unfortunately this approach does not work on WhatDoTheyKnow, where the admin pages are served via a different domain (secure.mysociety.org) and so do not share session information with the rest of the site. This commit changes it to mark the PostRedirect with circumstance == "login_as", which signals the user controller to log out the previous user even if they are an admin. In other words, the user is logged out on the main site rather than the admin site, skirting this problem. Closes #450.
* Admin users clicking confirmation linksRobin Houston2012-03-13-1/+1
| | | | Fixes #446. See issue for details.
* Don’t index unconfirmed usersRobin Houston2012-02-06-0/+16
| | | | Closes #415.
* Let admin users use auto-login URLsRobin Houston2012-02-06-1/+53
| | | | | | Don't change logged-in user from an admin when visiting a auto-login URL. Closes #306.
* Return 404 for /feed/user/no_such_userRobin Houston2012-02-03-0/+5
| | | | Fixes #407.
* Test should not depend on nondeterministic orderRobin Houston2012-02-03-9/+12
| | | | | | | | | | | | | | | | | | Issue #409 seems to be another problem of the same type as #408, though with the important difference that the bug in this case is in the test suite rather than the code under test. RequestMailer sends alert emails warning of overdue requests. However it does not specify the order that these messages are sent in, but runs over the overdue requests in whatever order they are returned by a database query (that does not have an order by clause). Therefore it is not safe for the test code to assume that the alert mails will have been sent in a particular order: just as with #408 it seems that they were *usually* sent in the order assumed by the test code, but occasionally not -- which would result in sporadic test failures. Closes #409.
* Eliminate trailing spaces in test namesRobin Houston2012-02-03-4/+4
| | | | Really, what was that about?
* Merge branch 'wdtk' into release/0.5Robin Houston2012-02-01-66/+41
|\ | | | | | | | | Conflicts: locale/app.pot
| * issue #351 reduxRobin Houston2012-02-01-4/+41
| | | | | | | | Corrected diagnosis, test & fix for issue #351. Fixes #351.
| * Load all fixtures for all testsRobin Houston2012-01-31-62/+0
| | | | | | | | | | | | | | | | | | The ad hoc specification of fixtures has been an ongoing source of bugs in the tests. The straw that broke the camel’s back is that 7c6eb09 requires the fixtures to be loaded in order (i.e. children before their parents), and it would have been a painful process to reorder all the dozens of different fixture lists, but the test system ought to be more reliable this way.
* | Merge branch 'issue_393' of https://github.com/henare/alaveteli into release/0.5Seb Bacon2012-01-31-0/+8
|\ \ | |/ |/|
| * Fixes #393 - Route the mass_assign_tags action so it does what it says on ↵Henare Degan2012-01-31-0/+8
| | | | | | | | the tin
* | Merge branch 'wdtk' into release/0.5Robin Houston2012-01-31-2/+2
|\ \ | | | | | | | | | | | | | | | Conflicts: config/general.yml-example doc/CHANGES.md
| * | Correct copy-pastoRobin Houston2012-01-31-2/+2
| |/ | | | | | | | | I am not sure why the tests anyway passed with this mistake, but clearly those trailing .should's ought not to have been there.
* | Fix test failure introduced in commit 24bbaa5afac5ce27c351e3b460be1b0182446ba1Seb Bacon2012-01-30-1/+7
| |
* | Make better wording at the top of the page listing subsets of public bodies. ↵Seb Bacon2012-01-30-1/+4
|/ | | | At the same time, cause the tests not to rely on WDTK data. Fixes #396
* Rate limitingRobin Houston2012-01-29-0/+53
| | | | | | Add the capability to specify a limit to the number of requests a user can make per day, which can be turned off for specific users in the admin interface.
* Test duplicate requests are coalescedRobin Houston2012-01-29-1/+5
| | | | Test that duplicate requests are coalesced on the front page.
* Change order of requests on front pageRobin Houston2012-01-29-1/+6
| | | | | | | Put the most-recently-answered first, rather than the most-recently-reclassified. This is inspired by issue #370, though it does not fix all the issues raised in that ticket. (The wording is still outright misleading in some cases.)
* More test data, and fix testsRobin Houston2012-01-29-27/+53
| | | | | | Add some more test data, and fix the tests to accommodate both this new test data and the fact that raw emails are now correctly loaded into the test environment.
* Load all raw emails for testingRobin Houston2012-01-29-23/+23
| | | | | | | | | | | Previously there was just one raw email, and the test code relied on that fact. Generalise it to handle multiple raw emails. This change causes a number of tests to fail, because it exposes failures that should have happened when the second raw email was added but were masked by the fact that the text of this second raw email was never loaded. These failures will be fixed in the next commit.
* clearing the test censor rules in an ensure blockRobin Houston2012-01-27-7/+9
| | | | | | Might as well be consistent about clearing the test censor rules in an ensure block. This would only mean that an exception in one test is less likely to cause unrelated failures in another.
* More test data and a new testRobin Houston2012-01-27-6/+19
| | | | | This is a test for what I thought issue #370 might be. However this test is passing, so it isn’t that.
* Add a trivial test for the list of recent requestsRobin Houston2012-01-27-0/+12
|
* Refactor test code so new test data can be addedRobin Houston2012-01-26-64/+115
| | | | | | | | Previously many of the tests made assumptions about the global structure of the test data set: the total number of requests, for example, or the names of all public bodies. This makes it difficult to add to the test data. This change is intended to make the test data easier to extend by eliminating such global assumptions.
* Fix #372Robin Houston2012-01-26-10/+26
|
* Correct test titleRobin Houston2012-01-25-1/+1
|
* Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtkSeb Bacon2012-01-25-19/+79
|\ | | | | | | | | Conflicts: app/controllers/request_controller.rb
| * More better test isolationRobin Houston2012-01-24-0/+1
| | | | | | | | | | Towards #361. Fixes: spec/models/xapian_spec.rb spec/controllers/user_controller_spec.rb
| * Improve test isolationRobin Houston2012-01-24-0/+2
| | | | | | | | | | Towards #361. Fixes: spec/models/xapian_spec.rb spec/controllers/general_controller_spec.rb
| * Fix sporadic test failureRobin Houston2012-01-24-1/+6
| | | | | | | | Another contribution to #361.
| * Fix a bunch of order-dependent failuresRobin Houston2012-01-24-1/+1
| | | | | | | | This fixes a lot of the failures in #361.
| * Add missing fixturesRobin Houston2012-01-23-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this addition, the "shows a user" test would fail unless run in a context where the public body fixtures had already been loaded, with an error like this: ActionView::TemplateError in 'AdminUserController when administering users shows a user' undefined method `name' for nil:NilClass On line #14 of app/views/admin_request/_some_requests.rhtml 11: <% for info_request in info_requests %> 12: <tr class="<%= cycle('odd', 'even') %>"> 13: <td><%= request_both_links(info_request) %></td> 14: <td><%= public_body_both_links(info_request.public_body) %></td> 15: <td><%= user_both_links(info_request.user) %></td> 16: <% for column in InfoRequest.content_columns.map { |c| c.name } - [ "title", "url_title" ] %> 17: <td><%=h info_request.send(column) %></td>
| * Remove assumptionRobin Houston2012-01-20-6/+5
| | | | | | | | | | | | | | I feel uncomfortable about the assumption that FastGettext.default_available_locales is always equal to I18n.available_locales. Even if that’s true now, it might not always be -- and if a bug causes them to become erroneously different, the previous code would have masked that.
| * Clear routing filters while tests are runningRobin Houston2012-01-20-0/+10
| | | | | | | | | | | | This fixes a test failure that would show up when running this spec in isolation -- but not necessarily when running all tests, depending on the order they run in.
| * Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtkRobin Houston2012-01-20-10/+49
| |\
| | * Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtkRobin Houston2012-01-20-1/+11
| | |\
| | * | Make sure the FakeWeb registry is kept cleanRobin Houston2012-01-20-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To be fair this change does not seem to make any tests pass that didn’t pass before, but (based on my limited understanding) it seems like a good idea. It also conforms to how FakeWeb is used in application_controller_spec.rb.
| | * | Be sure to restore RoutingFiltersRobin Houston2012-01-20-10/+42
| | | | | | | | | | | | | | | | | | | | | | | | There were some order-dependent test failures that turned out to be caused by the fact that the RoutingFilters were cleared and not subsequently restored, by some tests.
| * | | Improved test isolationRobin Houston2012-01-20-0/+4
| | |/ | |/| | | | | | | | | | The test “AdminRequestController when administering requests shows a public body” would fail when this spec is run on its own twice in succession.
* | | Return a 404 for missing user profile pictures. Fixes #363Seb Bacon2012-01-24-0/+7
| | |
* | | Ensure short cache keys for interlock. Fixes #362Seb Bacon2012-01-24-0/+5
| | |
* | | Bug: we are causing a 500 when trying to raise 404 because the arguments to ↵Seb Bacon2012-01-24-0/+9
|/ / | | | | | | the exception constructor are wrong.
* / Don't allow users to page beyond a certain number of results (because in ↵Seb Bacon2012-01-20-1/+11
|/ | | | large databases, the sorting of such large batches causes an extreme slowdown).
* Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtkSeb Bacon2012-01-19-1/+29
|\
| * Return a 404 for broken attachment urls. Fixes #351.Seb Bacon2012-01-18-0/+10
| |
| * Fix more test breakageSeb Bacon2012-01-18-1/+7
| |
| * Catch timeouts and other extra errors when connection to 3rd party websites ↵Seb Bacon2012-01-18-1/+8
| | | | | | | | fails.
| * Ensure request typeahead search is tested properly (and fix a validation error).Seb Bacon2012-01-18-0/+2
| |