Commit Graph

16 Commits

Author SHA1 Message Date
Bianca Nenciu
117417848e Remove like on change of ownership. (#5038) 2017-08-11 09:55:00 +02:00
Guo Xiang Tan
5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Guo Xiang Tan
e3b6f9b8ae FIX: Do not update user stats like counts for private messages. 2017-01-16 11:07:53 +08:00
Sam
2f6a4cc6de remove UserActionObserver, replace with after_save and service
interestingly there was some left over dead code from when stars
existed in the topic_users table
2016-12-22 16:46:53 +11:00
Arpit Jalan
4a2f0e772c add specs for post ownership change without revision 2016-08-20 01:27:48 +05:30
Robin Ward
83e46cc302 FIX: Restrict changing ownership to one topic 2016-06-17 14:20:14 -04:00
Sam Saffron
e947c3b9ec correct for earlier versions of ruby 2016-03-17 09:25:48 +11:00
Sam Saffron
8577b7e2cc FIX: setting owner on topic should not bump topic 2016-03-17 08:32:56 +11:00
Sam Saffron
b300d60086 FIX: when changing owner of last post user list on topic incorrect 2016-03-16 23:49:54 +11:00
Andy Waite
3e50313fdc Prepare for separation of RSpec helper files
Since rspec-rails 3, the default installation creates two helper files:
* `spec_helper.rb`
* `rails_helper.rb`

`spec_helper.rb` is intended as a way of running specs that do not
require Rails, whereas `rails_helper.rb` loads Rails (as Discourse's
current `spec_helper.rb` does).

For more information:

https://www.relishapp.com/rspec/rspec-rails/docs/upgrade#default-helper-files

In this commit, I've simply replaced all instances of `spec_helper` with
`rails_helper`, and renamed the original `spec_helper.rb`.

This brings the Discourse project closer to the standard usage of RSpec
in a Rails app.

At present, every spec relies on loading Rails, but there are likely
many that don't need to. In a future pull request, I hope to introduce a
separate, minimal `spec_helper.rb` which can be used in tests which
don't rely on Rails.
2015-12-01 20:39:42 +00:00
Neil Lalonde
3a67c02c7a FIX: change topic creator wasn't removing the topic from the previous creator's activity stream 2015-05-29 17:39:36 -04:00
Arthur Neves
b8cbe51026
Convert specs to RSpec 2.99.2 syntax with Transpec
This conversion is done by Transpec 3.1.0 with the following command:
    transpec

* 424 conversions
    from: obj.should
      to: expect(obj).to

* 325 conversions
    from: == expected
      to: eq(expected)

* 38 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 15 conversions
    from: =~ /pattern/
      to: match(/pattern/)

* 9 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 5 conversions
    from: lambda { }.should_not
      to: expect { }.not_to

* 4 conversions
    from: lambda { }.should
      to: expect { }.to

* 2 conversions
    from: -> { }.should
      to: expect { }.to

* 2 conversions
    from: -> { }.should_not
      to: expect { }.not_to

* 1 conversion
    from: === expected
      to: be === expected

* 1 conversion
    from: =~ [1, 2]
      to: match_array([1, 2])

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2015-04-25 11:18:35 -04:00
Neil Lalonde
2585962552 fix spec that can fail when comparing timestamps. I only care that it isn't null. 2015-03-11 16:51:29 -04:00
Neil Lalonde
dece5a351a more fixes for post ownership change and user deletion 2015-03-11 15:54:20 -04:00
Neil Lalonde
35c58c1b00 FIX: after changing post owner, profile pages still showed previous owner and incorrect topic and post counts 2015-03-03 14:15:11 -05:00
Neil Lalonde
1bf4f34049 FIX: topic and post counts are not updated when ownership of a post is changed 2015-03-02 12:13:21 -05:00