Commit Graph

433 Commits

Author SHA1 Message Date
Brenda Wallace
78aa049502 Fixed comment model spec 2017-10-23 10:44:37 +01:00
Brenda Wallace
97c7277a73 fixed up ambigous regex and use of expect in specs 2017-10-23 10:44:37 +01:00
Brenda Wallace
46efcf3e61 Spec for Forum owners and Crop creators deleting their accounts 2017-06-09 23:25:40 +12:00
Brenda Wallace
910a9673dc Unsubscribes newsletter before member destroying 2017-06-09 22:39:07 +12:00
Brenda Wallace
582dd2c9fd Checks the deleted members are not found 2017-06-09 21:28:47 +12:00
Shiny
7621da7041 Merge branch 'dev' into issue-1044-account-deletion 2017-05-30 20:39:44 +12:00
Brenda Wallace
ff1c835cda Moving the planting predictions to own service 2017-05-29 22:45:14 +12:00
Brenda Wallace
a6964a8f4e Update specs to join before checking member is destroyed. 2017-05-21 21:59:28 +12:00
Brenda Wallace
121d3d99fe Tests for retrieving data of deleted members 2017-05-21 11:36:07 +12:00
Brenda Wallace
7d2a2b96a2 Only show gardens of members who are not deleted 2017-05-21 11:17:09 +12:00
Brenda Wallace
6f58f266a6 Moving has_photos scope to PhotoCapable
-
2017-05-20 15:46:37 +12:00
Brenda Wallace
42cea2ebde Fixed spec for days_before_maturity 2017-04-28 20:48:25 +12:00
Brenda Wallace
4ea681984f Call calc_and_set_days_before_maturity from controller 2017-04-28 20:48:25 +12:00
Brenda Wallace
b820615081 Moved planting maturity to planting model. simplified controller 2017-04-28 20:48:25 +12:00
Brenda Wallace
85a368999b we love rubocop 2017-04-13 14:30:51 +12:00
Daniel O'Connor
6ba4b4560e Fix #1305 by adding aggregation
Expand test coverage
member_id is owner_id on plantings
Argue with ActionView::Template::Error about what we can group on

Rename variable
2017-04-13 14:30:41 +12:00
Brenda Wallace
b8ea6116d4 Add photos to plantings to make them interesting in the spec 2017-03-29 10:46:15 +13:00
Brenda Wallace
2521e52d71 Remove test called to Planting.interesting(...)
Interesting plantings with no photos is not used in the code.
The method was converted to a scope.
2017-03-29 08:28:58 +13:00
Brenda Wallace
322f28eaa6 bugfix in some spec expectations 2017-03-05 00:36:10 +13:00
Brenda Wallace
4eda3a506b Fix up csv importer, should make duplicates
Now matches the old functionality.
2017-02-24 20:08:01 +13:00
Brenda Wallace
5abc1fb80e duplicate alt name spec (and adding to crop) 2017-02-23 15:35:29 +13:00
Brenda Wallace
0a840abc58 Added specs for duplicate sci names 2017-02-23 15:35:29 +13:00
Brenda Wallace
968e9bd3ad Rubocop fix up in spec 2017-02-23 15:35:29 +13:00
Brenda Wallace
ddd0e0c285 Fixed typo in string causing spec to fail 2017-02-23 15:35:29 +13:00
Brenda Wallace
00952d5ef6 Updating more specs for new csv importer interface 2017-02-23 15:35:29 +13:00
Brenda Wallace
a0e1d8b11d Update scientific name model spec 2017-02-23 15:35:29 +13:00
Brenda Wallace
3d7f2ec20c Updating specs to match new csv importer 2017-02-23 15:35:29 +13:00
Brenda Wallace
2f9961651f Call new csv importer from specs 2017-02-23 15:35:29 +13:00
Shiny
b8884beb2f Merge branch 'dev' into test_runners 2017-02-21 11:31:02 +13:00
Brenda Wallace
50624fb2cb Style/MultilineBlockLayout fix 2017-02-19 16:17:03 +13:00
Brenda Wallace
e184503caa Fix up to match rubocop's MultilineMethodCallBraceLayout recommendation 2017-02-19 16:17:03 +13:00
Miles Gould
9030e5b978 Merge branch 'dev' into test_runners 2017-02-16 13:31:39 +00:00
Brenda Wallace
a46b8ebe76 Fix up all UnneededInterpolation 2017-02-16 12:26:47 +13:00
Miles Gould
b8c0882642 Tag ElasticSearch-related tests 2017-02-07 14:27:14 +00:00
Brenda Wallace
1dc44c9edc Filled in the 3 pending planting specs 2017-02-07 18:29:10 +13:00
Brenda Wallace
8408fdc845 Moved popular plant plarts calculation into sql 2017-02-06 13:22:18 +13:00
Brenda Wallace
ff50ec65d0 Merge remote-tracking branch 'upstream/dev' into HEAD 2017-01-22 18:26:29 +13:00
Brenda Wallace
0fa9f54c9c Rename member.has_role? to role? 2017-01-14 20:54:43 +13:00
Brenda Wallace
f214f608ff Rename member.is_paid? to paid? 2017-01-14 20:51:22 +13:00
Miles Gould
4b1cdc5650 Test Model.newsletter_(un)subscribe
I'm not very happy with this change as-is. The tests are very shallow
(they wouldn't have caught the bug @tconquest and I found in this code,
for instance), and use the deprecated `receive_message_chain` method.
From the RSpec docs:

"Chains can be arbitrarily long, which makes it quite painless to
violate the Law of Demeter in violent ways, so you should consider any
use of receive_message_chain a code smell.  Even though not all code
smells indicate real problems (think fluent interfaces),
receive_message_chain still results in brittle examples. For example, if
you write allow(foo).to receive_message_chain(:bar, :baz => 37) in a
spec and then the implementation calls foo.baz.bar, the stub will not
work."

Further work needed.
2016-12-19 22:15:53 +00:00
Miles Gould
4f1c94bfb9 Fix warnings in member_spec 2016-12-19 20:44:18 +00:00
Miles Gould
70f589d59b Replace instance vars with locals in member_spec 2016-12-19 20:33:43 +00:00
Miles Gould
f5eede6072 Improve tests for Member.interesting 2016-12-19 20:29:05 +00:00
Miles Gould
abb9acd04a post_spec: fix warnings
Several "unused variable" warnings (due to replacing unused instance
variables with unused locals) and one warning about ambiguous
lack-of-brackets.
2016-12-19 16:40:05 +00:00
Miles Gould
67faa5554c post_spec: replace instance vars with local vars
The @ in front of a variable makes it an instance variable of the
surrounding object. There's no point doing that for variables that are
only used in a single function, so I've made such variables in the file
post_spec.rb into function-local variables. We should do this more
generally: there are a lot of instances of this (anti?)pattern in our
test suite.
2016-12-19 16:36:46 +00:00
Miles Gould
59b86c9b0c Replace << with string-interpolation in post_spec 2016-12-19 16:33:41 +00:00
Miles Gould
7239cf068b Test [member name](member) mention syntax 2016-12-19 16:31:32 +00:00
Miles Gould
c23e80b56d Test Post.recently_active 2016-12-19 16:26:17 +00:00
Miles Gould
b011fc9bae Test Post.comment_count 2016-12-19 16:17:31 +00:00
Miles Gould
b40974d4c3 Test Crop.create_from_csv with missing parent
I couldn't work out how to test that the error is logged.
2016-12-19 16:15:19 +00:00