aboutsummaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeLines
...
* | | Add some tests for the public body home page calculationHenare Degan2012-02-16-0/+22
|/ /
* | Set a "Content-Disposition: attachment" header when downloading files. ↵Seb Bacon2012-02-15-1/+9
| | | | | | | | Closes #428
* | Make /similar/request/NONESUCH a 404 not 500 errorRobin Houston2012-02-10-0/+24
|/ | | | Fixes #421.
* Don’t index unconfirmed usersRobin Houston2012-02-06-0/+16
| | | | Closes #415.
* Let admin users use auto-login URLsRobin Houston2012-02-06-4/+56
| | | | | | 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-5/+5
| | | | Really, what was that about?
* Better test assertionsRobin Houston2012-02-03-17/+17
| | | | | Change the test assertions so they give more informative errors when they fail -- as they sometimes do: see issue #408.
* Merge branch 'wdtk' into release/0.5Robin Houston2012-02-01-150/+43
|\ | | | | | | | | Conflicts: locale/app.pot
| * issue #351 reduxRobin Houston2012-02-01-4/+41
| | | | | | | | Corrected diagnosis, test & fix for issue #351. Fixes #351.
| * Update testRobin Houston2012-01-31-1/+1
| | | | | | | | Update test to take account of change 76fd5f9.
| * Load all fixtures for all testsRobin Houston2012-01-31-145/+1
| | | | | | | | | | | | | | | | | | 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/+12
| | | | | | | | At the same time, cause the tests not to rely on WDTK data. Fixes #396
* | Add some tag fixtures, so that the default Alaveteli theme's public body ↵Seb Bacon2012-01-30-0/+36
|/ | | | categories have something to work with. Currently not used in any tests.
* 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-2/+185
| | | | Test that duplicate requests are coalesced on the front page.
* Change order of requests on front pageRobin Houston2012-01-29-7/+12
| | | | | | | 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-41/+108
| | | | | | 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-57/+75
| | | | | | | | | | | 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-8/+119
| | | | | This is a test for what I thought issue #370 might be. However this test is passing, so it isn’t that.
* Remove stray puts in test codeRobin Houston2012-01-27-1/+0
| | | | | This was added for temporary debugging purposes, and ought to have been removed.
* Add a trivial test for the list of recent requestsRobin Houston2012-01-27-10/+73
|
* Refactor test code so new test data can be addedRobin Houston2012-01-26-107/+176
| | | | | | | | 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
|
* Simplify search logic so it doesn't depend on sessions. Also fixes #338Seb Bacon2012-01-25-3/+3
|
* Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtkSeb Bacon2012-01-25-61/+117
|\ | | | | | | | | Conflicts: app/controllers/request_controller.rb
| * More test isolationRobin Houston2012-01-24-0/+1
| | | | | | | | | | Towards #361. (Possibly even the very last one!) Fixes: spec/models/xapian_spec.rb spec/integration/search_request_spec.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
| * A couple more test isolation failuresRobin Houston2012-01-24-0/+2
| | | | | | | | Towards #361
| * Improve test isolationRobin Houston2012-01-24-0/+1
| | | | | | | | Another brick in the wall (#361)
| * Fix sporadic test failureRobin Houston2012-01-24-1/+6
| | | | | | | | Another contribution to #361.
| * Make sure the raw emails are loadedRobin Houston2012-01-24-38/+14
| | | | | | | | | | This fixes (at least) one of the failures in #361, viz spec/controllers/admin_request_controller_spec.rb spec/models/xapian_spec.rb
| * 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>
| * Improve test isolationRobin Houston2012-01-22-1/+2
| | | | | | | | This test was failing if run after, for example, general_controller_spec.rb.
| * 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-13/+67
| |\
| | * Merge branch 'wdtk' of github.com:sebbacon/alaveteli into wdtkRobin Houston2012-01-20-1/+13
| | |\
| | * | 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-13/+60
| | | | | | | | | | | | | | | | | | | | | | | | 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.