mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
This commit is contained in:
@@ -60,33 +60,33 @@ describe PostOwnerChanger do
|
||||
change_owners
|
||||
|
||||
p1user.reload; p2user.reload; user_a.reload
|
||||
p1user.topic_count.should == 0
|
||||
p1user.post_count.should == 0
|
||||
p2user.topic_count.should == 0
|
||||
p2user.post_count.should == 0
|
||||
user_a.topic_count.should == 1
|
||||
user_a.post_count.should == 2
|
||||
p1user.user_stat.first_post_created_at.should == nil
|
||||
p2user.user_stat.first_post_created_at.should == nil
|
||||
p1user.user_stat.topic_reply_count.should == 0
|
||||
p2user.user_stat.topic_reply_count.should == 0
|
||||
user_a.user_stat.first_post_created_at.should be_present
|
||||
expect(p1user.topic_count).to eq(0)
|
||||
expect(p1user.post_count).to eq(0)
|
||||
expect(p2user.topic_count).to eq(0)
|
||||
expect(p2user.post_count).to eq(0)
|
||||
expect(user_a.topic_count).to eq(1)
|
||||
expect(user_a.post_count).to eq(2)
|
||||
expect(p1user.user_stat.first_post_created_at).to eq(nil)
|
||||
expect(p2user.user_stat.first_post_created_at).to eq(nil)
|
||||
expect(p1user.user_stat.topic_reply_count).to eq(0)
|
||||
expect(p2user.user_stat.topic_reply_count).to eq(0)
|
||||
expect(user_a.user_stat.first_post_created_at).to be_present
|
||||
end
|
||||
|
||||
it "updates UserAction records" do
|
||||
g = Guardian.new(editor)
|
||||
UserAction.stats(user_a.id, g).should == []
|
||||
expect(UserAction.stats(user_a.id, g)).to eq([])
|
||||
|
||||
change_owners
|
||||
|
||||
UserAction.stats(p1user.id, g).should == []
|
||||
UserAction.stats(p2user.id, g).should == []
|
||||
expect(UserAction.stats(p1user.id, g)).to eq([])
|
||||
expect(UserAction.stats(p2user.id, g)).to eq([])
|
||||
stats = UserAction.stats(user_a.id, g)
|
||||
stats.size.should == 2
|
||||
stats[0].action_type.should == UserAction::NEW_TOPIC
|
||||
stats[0].count.should == 1
|
||||
stats[1].action_type.should == UserAction::REPLY
|
||||
stats[1].count.should == 1
|
||||
expect(stats.size).to eq(2)
|
||||
expect(stats[0].action_type).to eq(UserAction::NEW_TOPIC)
|
||||
expect(stats[0].count).to eq(1)
|
||||
expect(stats[1].action_type).to eq(UserAction::REPLY)
|
||||
expect(stats[1].count).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user