Skip to content

A platform for community discussion. Free, open, simple.

Fix another failing spec.

Guo Xiang Tan49f39ca64ddc
diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb
index 0f560a561c8..32a5a4e3f43 100644
--- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb
+++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/advanced_user_narrative_spec.rb
@@ -108,15 +108,17 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
#{I18n.t('discourse_narrative_bot.advanced_user_narrative.edit.instructions', base_uri: '')}
RAW
- new_post = topic.ordered_posts.last(2).first
-
- expect(narrative.get_data(user)).to eq("topic_id" => new_post.topic.id,
- "state" => "tutorial_edit",
- "last_post_id" => new_post.id,
- "track" => described_class.to_s,
- "tutorial_edit" => {
+ new_post = Topic.last.ordered_posts.last(2).first
+
+ expect(narrative.get_data(user)).to eq(
+ "topic_id" => new_post.topic.id,
+ "state" => "tutorial_edit",
+ "last_post_id" => new_post.id,
+ "track" => described_class.to_s,
+ "tutorial_edit" => {
"post_id" => Post.last.id
- })
+ }
+ )
expect(new_post.raw).to eq(expected_raw.chomp)
expect(new_post.topic.id).to_not eq(topic.id)