diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a96706209..f1245aced 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 400` -# on 2024-03-14 03:12:58 UTC using RuboCop version 1.62.0. +# on 2024-03-23 21:41:23 UTC using RuboCop version 1.62.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -144,7 +144,7 @@ RSpec/ExampleLength: - 'spec/utils/feed_discovery_spec.rb' - 'spec/utils/opml_parser_spec.rb' -# Offense count: 16 +# Offense count: 17 # Configuration parameters: EnforcedStyle. # SupportedStyles: allow, expect RSpec/MessageExpectation: @@ -170,7 +170,7 @@ RSpec/MultipleExpectations: - 'spec/utils/i18n_support_spec.rb' - 'spec/utils/opml_parser_spec.rb' -# Offense count: 35 +# Offense count: 24 # Configuration parameters: AllowSubject, Max. RSpec/MultipleMemoizedHelpers: Exclude: @@ -180,11 +180,6 @@ RSpec/MultipleMemoizedHelpers: - 'spec/repositories/story_repository_spec.rb' - 'spec/requests/feeds_controller_spec.rb' - 'spec/requests/imports_controller_spec.rb' - - 'spec/requests/stories_controller_spec.rb' - - 'spec/requests/tutorials_controller_spec.rb' - - 'spec/tasks/remove_old_stories_spec.rb' - - 'spec/utils/feed_discovery_spec.rb' - - 'spec/utils/i18n_support_spec.rb' # Offense count: 5 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. @@ -199,7 +194,7 @@ RSpec/NestedGroups: Exclude: - 'spec/integration/feed_importing_spec.rb' -# Offense count: 25 +# Offense count: 26 # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. RSpec/VerifiedDoubles: Exclude: diff --git a/spec/commands/fever_api/read_items_spec.rb b/spec/commands/fever_api/read_items_spec.rb index ee46497e4..93a998c68 100644 --- a/spec/commands/fever_api/read_items_spec.rb +++ b/spec/commands/fever_api/read_items_spec.rb @@ -2,7 +2,7 @@ RSpec.describe FeverAPI::ReadItems do it "returns a list of unread items including total count" do - stories = create_list(:story, 3, :unread) + stories = create_list(:story, 3) authorization = Authorization.new(default_user) items = stories.map(&:as_fever_json) @@ -11,7 +11,7 @@ end it "returns a list of unread items with empty since_id" do - stories = create_list(:story, 3, :unread) + stories = create_list(:story, 3) authorization = Authorization.new(default_user) items = stories.map(&:as_fever_json) @@ -20,7 +20,7 @@ end it "returns a list of unread items since id including total count" do - story, *other_stories = create_list(:story, 3, :unread) + story, *other_stories = create_list(:story, 3) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, items: nil, since_id: story.id)) diff --git a/spec/commands/fever_api/sync_unread_item_ids_spec.rb b/spec/commands/fever_api/sync_unread_item_ids_spec.rb index 2659607f8..0155cec68 100644 --- a/spec/commands/fever_api/sync_unread_item_ids_spec.rb +++ b/spec/commands/fever_api/sync_unread_item_ids_spec.rb @@ -2,7 +2,7 @@ RSpec.describe FeverAPI::SyncUnreadItemIds do it "returns a list of unread items if requested" do - stories = create_list(:story, 3, :unread) + stories = create_list(:story, 3) authorization = Authorization.new(default_user) expect(described_class.call(authorization:, unread_item_ids: nil)) diff --git a/spec/commands/fever_api/write_mark_feed_spec.rb b/spec/commands/fever_api/write_mark_feed_spec.rb index 7ebb58593..466072e98 100644 --- a/spec/commands/fever_api/write_mark_feed_spec.rb +++ b/spec/commands/fever_api/write_mark_feed_spec.rb @@ -9,7 +9,7 @@ def params(feed, before:) it "marks the feed stories as read before the given timestamp" do feed = create(:feed) - story = create(:story, :unread, feed:, created_at: 1.week.ago) + story = create(:story, feed:, created_at: 1.week.ago) expect { described_class.call(**params(feed, before: 1.day.ago.to_i)) } .to change { story.reload.is_read? }.from(false).to(true) @@ -17,7 +17,7 @@ def params(feed, before:) it "does not mark the feed stories as read after the given timestamp" do feed = create(:feed) - story = create(:story, :unread, feed:) + story = create(:story, feed:) expect { described_class.call(**params(feed, before: 1.day.ago.to_i)) } .to not_change { story.reload.is_read? }.from(false) diff --git a/spec/commands/fever_api/write_mark_group_spec.rb b/spec/commands/fever_api/write_mark_group_spec.rb index b0d3e271e..1d4770d26 100644 --- a/spec/commands/fever_api/write_mark_group_spec.rb +++ b/spec/commands/fever_api/write_mark_group_spec.rb @@ -6,7 +6,7 @@ def authorization end it "marks the group stories as read before the given timestamp" do - story = create(:story, :unread, :with_group, created_at: 1.week.ago) + story = create(:story, :with_group, created_at: 1.week.ago) before = 1.day.ago id = story.group_id diff --git a/spec/commands/fever_api/write_mark_item_spec.rb b/spec/commands/fever_api/write_mark_item_spec.rb index cf00d59a9..4c52b27aa 100644 --- a/spec/commands/fever_api/write_mark_item_spec.rb +++ b/spec/commands/fever_api/write_mark_item_spec.rb @@ -3,7 +3,7 @@ RSpec.describe FeverAPI::WriteMarkItem do context "when as: 'read'" do it "marks the story as read" do - story = create(:story, :unread) + story = create(:story) authorization = Authorization.new(story.user) params = { authorization:, mark: "item", as: "read", id: story.id } diff --git a/spec/commands/story/mark_all_as_read_spec.rb b/spec/commands/story/mark_all_as_read_spec.rb index c82005c06..f30eea330 100644 --- a/spec/commands/story/mark_all_as_read_spec.rb +++ b/spec/commands/story/mark_all_as_read_spec.rb @@ -2,7 +2,7 @@ RSpec.describe MarkAllAsRead do it "marks all stories as read" do - stories = create_pair(:story, :unread) + stories = create_pair(:story) expect { described_class.call(stories.map(&:id)) } .to change_all_records(stories, :is_read).from(false).to(true) diff --git a/spec/commands/story/mark_feed_as_read_spec.rb b/spec/commands/story/mark_feed_as_read_spec.rb index 2f9dad678..87d5aa43f 100644 --- a/spec/commands/story/mark_feed_as_read_spec.rb +++ b/spec/commands/story/mark_feed_as_read_spec.rb @@ -2,7 +2,7 @@ RSpec.describe MarkFeedAsRead do it "marks feed stories as read before timestamp" do - story = create(:story, :unread, created_at: 1.week.ago) + story = create(:story, created_at: 1.week.ago) before = 1.day.ago expect { described_class.call(story.feed_id, before) } diff --git a/spec/commands/story/mark_group_as_read_spec.rb b/spec/commands/story/mark_group_as_read_spec.rb index b94ec85a9..2204b3438 100644 --- a/spec/commands/story/mark_group_as_read_spec.rb +++ b/spec/commands/story/mark_group_as_read_spec.rb @@ -3,7 +3,7 @@ RSpec.describe MarkGroupAsRead do describe "#mark_group_as_read" do it "marks group as read" do - story = create(:story, :with_group, :unread, created_at: 1.week.ago) + story = create(:story, :with_group, created_at: 1.week.ago) timestamp = 1.day.ago expect { described_class.call(story.group_id, timestamp) } @@ -11,7 +11,7 @@ end it "does not mark any group as read when group is not provided" do - story = create(:story, :with_group, :unread, created_at: 1.week.ago) + story = create(:story, :with_group, created_at: 1.week.ago) timestamp = 1.day.ago expect { described_class.call(nil, timestamp) } @@ -19,7 +19,7 @@ end it "marks as read all feeds when group is 0 (KINDLING_GROUP_ID)" do - story = create(:story, :with_group, :unread, created_at: 1.week.ago) + story = create(:story, :with_group, created_at: 1.week.ago) timestamp = 1.day.ago expect { described_class.call(0, timestamp) } @@ -27,7 +27,7 @@ end it "marks as read all feeds when group is -1 (SPARKS_GROUP_ID)" do - story = create(:story, :with_group, :unread, created_at: 1.week.ago) + story = create(:story, :with_group, created_at: 1.week.ago) timestamp = 1.day.ago expect { described_class.call(-1, timestamp) } diff --git a/spec/factories/stories.rb b/spec/factories/stories.rb index 56acd5ef1..9f0895c5b 100644 --- a/spec/factories/stories.rb +++ b/spec/factories/stories.rb @@ -15,10 +15,6 @@ is_starred { true } end - trait :unread do - is_read { false } - end - trait :with_group do feed factory: [:feed, :with_group] end diff --git a/spec/models/feed_spec.rb b/spec/models/feed_spec.rb index 4b5719fc3..6dd1810c6 100644 --- a/spec/models/feed_spec.rb +++ b/spec/models/feed_spec.rb @@ -3,7 +3,7 @@ RSpec.describe "Feed" do describe ".with_unread_stories_counts" do it "returns feeds with unread stories counts" do - create(:story, :unread) + create(:story) feed = Feed.with_unread_stories_counts.first @@ -22,7 +22,7 @@ describe "#unread_stories" do it "returns stories where is_read is false" do feed = create(:feed) - story = create(:story, :unread, feed:) + story = create(:story, feed:) expect(feed.unread_stories).to eq([story]) end diff --git a/spec/models/story_spec.rb b/spec/models/story_spec.rb index 603a4a3f3..247792ff7 100644 --- a/spec/models/story_spec.rb +++ b/spec/models/story_spec.rb @@ -3,7 +3,7 @@ RSpec.describe "Story" do describe ".unread" do it "returns stories where is_read is false" do - story = create(:story, :unread) + story = create(:story) expect(Story.unread).to eq([story]) end diff --git a/spec/repositories/story_repository_spec.rb b/spec/repositories/story_repository_spec.rb index d79b1e1cb..d061f884d 100644 --- a/spec/repositories/story_repository_spec.rb +++ b/spec/repositories/story_repository_spec.rb @@ -121,7 +121,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") describe ".fetch_unread_by_timestamp_and_group" do it "returns unread stories before timestamp for group_id" do feed = create(:feed, group_id: 52) - story = create(:story, :unread, feed:, created_at: 5.minutes.ago) + story = create(:story, feed:, created_at: 5.minutes.ago) time = Time.zone.now stories = described_class.fetch_unread_by_timestamp_and_group(time, 52) @@ -141,7 +141,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "does not return unread stories after timestamp for group_id" do feed = create(:feed, group_id: 52) - create(:story, :unread, feed:, created_at: 5.minutes.ago) + create(:story, feed:, created_at: 5.minutes.ago) time = 6.minutes.ago stories = described_class.fetch_unread_by_timestamp_and_group(time, 52) @@ -151,7 +151,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "does not return stories before timestamp for other group_id" do feed = create(:feed, group_id: 52) - create(:story, :unread, feed:, created_at: 5.minutes.ago) + create(:story, feed:, created_at: 5.minutes.ago) time = Time.zone.now stories = described_class.fetch_unread_by_timestamp_and_group(time, 55) @@ -161,7 +161,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "does not return stories with no group_id before timestamp" do feed = create(:feed) - create(:story, :unread, feed:, created_at: 5.minutes.ago) + create(:story, feed:, created_at: 5.minutes.ago) time = Time.zone.now stories = described_class.fetch_unread_by_timestamp_and_group(time, 52) @@ -171,7 +171,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "returns unread stories before timestamp for nil group_id" do feed = create(:feed) - story = create(:story, :unread, feed:, created_at: 5.minutes.ago) + story = create(:story, feed:, created_at: 5.minutes.ago) time = Time.zone.now stories = described_class.fetch_unread_by_timestamp_and_group(time, nil) @@ -183,7 +183,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") describe ".fetch_unread_for_feed_by_timestamp" do it "returns unread stories for the feed before timestamp" do feed = create(:feed) - story = create(:story, :unread, feed:, created_at: 5.minutes.ago) + story = create(:story, feed:, created_at: 5.minutes.ago) time = 4.minutes.ago stories = @@ -194,7 +194,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "returns unread stories for the feed before string timestamp" do feed = create(:feed) - story = create(:story, :unread, feed:, created_at: 5.minutes.ago) + story = create(:story, feed:, created_at: 5.minutes.ago) timestamp = Integer(4.minutes.ago).to_s stories = @@ -216,7 +216,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "does not return unread stories for the feed after timestamp" do feed = create(:feed) - create(:story, :unread, feed:, created_at: 5.minutes.ago) + create(:story, feed:, created_at: 5.minutes.ago) time = 6.minutes.ago stories = @@ -227,7 +227,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") it "does not return unread stories for another feed before timestamp" do feed = create(:feed) - create(:story, :unread, created_at: 5.minutes.ago) + create(:story, created_at: 5.minutes.ago) time = 4.minutes.ago stories = @@ -239,8 +239,8 @@ def create_feed(url: "http://blog.golang.org/feed.atom") describe ".unread" do it "returns unread stories ordered by published date descending" do - story1 = create(:story, :unread, published: 5.minutes.ago) - story2 = create(:story, :unread, published: 4.minutes.ago) + story1 = create(:story, published: 5.minutes.ago) + story2 = create(:story, published: 4.minutes.ago) expect(described_class.unread).to eq([story2, story1]) end @@ -253,8 +253,8 @@ def create_feed(url: "http://blog.golang.org/feed.atom") end it "allows to override the order" do - story1 = create(:story, :unread, published: 5.minutes.ago) - story2 = create(:story, :unread, published: 4.minutes.ago) + story1 = create(:story, published: 5.minutes.ago) + story2 = create(:story, published: 4.minutes.ago) expect(described_class.unread(order: :asc)).to eq([story1, story2]) end @@ -262,22 +262,22 @@ def create_feed(url: "http://blog.golang.org/feed.atom") describe ".unread_since_id" do it "returns unread stories with id greater than given id" do - story1 = create(:story, :unread) - story2 = create(:story, :unread) + story1 = create(:story) + story2 = create(:story) expect(described_class.unread_since_id(story1.id)).to eq([story2]) end it "does not return read stories with id greater than given id" do - story1 = create(:story, :unread) + story1 = create(:story) create(:story, :read) expect(described_class.unread_since_id(story1.id)).to be_empty end it "does not return unread stories with id less than given id" do - create(:story, :unread) - story2 = create(:story, :unread) + create(:story) + story2 = create(:story) expect(described_class.unread_since_id(story2.id)).to be_empty end @@ -322,7 +322,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") end it "does not return unread stories" do - create(:story, :unread) + create(:story) expect(described_class.read).to be_empty end @@ -380,7 +380,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") end it "does not return unread stories older than the given number of days" do - create(:story, :unread, published: 6.days.ago) + create(:story, published: 6.days.ago) expect(described_class.unstarred_read_stories_older_than(5)).to be_empty end @@ -402,7 +402,7 @@ def create_feed(url: "http://blog.golang.org/feed.atom") end it "does not count unread stories" do - create_list(:story, 3, :unread) + create_list(:story, 3) expect(described_class.read_count).to eq(0) end diff --git a/spec/requests/fever_controller_spec.rb b/spec/requests/fever_controller_spec.rb index aea7d63dc..2ad3ad2d7 100644 --- a/spec/requests/fever_controller_spec.rb +++ b/spec/requests/fever_controller_spec.rb @@ -106,8 +106,8 @@ def expect_groups_response(groups, feeds_groups) end it "returns stories when 'items' and 'since_id'" do - create(:story, :unread, id: 5) - story_two = create(:story, :unread, id: 6) + create(:story, id: 5) + story_two = create(:story, id: 6) get("/fever", params: params(items: nil, since_id: 5)) @@ -116,7 +116,7 @@ def expect_groups_response(groups, feeds_groups) end it "returns stories when 'items' header is provided without 'since_id'" do - stories = create_pair(:story, :unread) + stories = create_pair(:story) get("/fever", params: params(items: nil)) @@ -141,7 +141,7 @@ def expect_groups_response(groups, feeds_groups) end it "returns unread items ids when 'unread_item_ids' header is provided" do - stories = create_pair(:story, :unread) + stories = create_pair(:story) get("/fever", params: params(unread_item_ids: nil)) @@ -161,7 +161,7 @@ def expect_groups_response(groups, feeds_groups) describe "#post" do it "commands to mark story as read" do - story = create(:story, :unread) + story = create(:story) post("/fever", params: params(mark: "item", as: "read", id: story.id)) @@ -193,7 +193,7 @@ def expect_groups_response(groups, feeds_groups) end it "commands to mark group as read" do - story = create(:story, :unread, :with_group, created_at: 1.week.ago) + story = create(:story, :with_group, created_at: 1.week.ago) before = Time.zone.now.to_i id = story.feed.group_id @@ -203,7 +203,7 @@ def expect_groups_response(groups, feeds_groups) end it "commands to mark entire feed as read" do - story = create(:story, :unread, created_at: 1.week.ago) + story = create(:story, created_at: 1.week.ago) before = Time.zone.now.to_i params = params(mark: "feed", as: "read", id: story.feed_id, before:) @@ -213,7 +213,7 @@ def expect_groups_response(groups, feeds_groups) describe "#index" do it "works with a trailing /" do - story = create(:story, :unread, created_at: 1.week.ago) + story = create(:story, created_at: 1.week.ago) before = Time.zone.now.to_i params = params(mark: "feed", as: "read", id: story.feed_id, before:) @@ -224,7 +224,7 @@ def expect_groups_response(groups, feeds_groups) describe "#update" do it "works with a trailing /" do - story = create(:story, :unread, created_at: 1.week.ago) + story = create(:story, created_at: 1.week.ago) before = Time.zone.now.to_i params = params(mark: "feed", as: "read", id: story.feed_id, before:) diff --git a/spec/requests/stories_controller_spec.rb b/spec/requests/stories_controller_spec.rb index 0a6acd199..210385dc8 100644 --- a/spec/requests/stories_controller_spec.rb +++ b/spec/requests/stories_controller_spec.rb @@ -1,15 +1,7 @@ # frozen_string_literal: true RSpec.describe StoriesController do - let(:story_one) { create(:story, :unread) } - let(:story_two) { create(:story, :unread) } - describe "GET /news" do - def setup - story_one - story_two - end - it "redirects to the setup page when no user exists" do get "/news" @@ -26,7 +18,7 @@ def setup it "display list of unread stories" do login_as(default_user) - setup + create(:story) get "/news" @@ -35,16 +27,16 @@ def setup it "displays the blog title and article title" do login_as(default_user) - setup + story = create(:story) get "/news" - expect(rendered).to have_text(story_one.headline) + expect(rendered).to have_text(story.headline) end it "displays all user actions" do login_as(default_user) - setup + create(:story) get "/news" @@ -53,7 +45,7 @@ def setup it "has correct footer links" do login_as(default_user) - setup + create(:story) get "/news" @@ -92,65 +84,67 @@ def setup end describe "#update" do + headers = { "CONTENT_TYPE" => "application/json" } + it "marks a story as read when it is_read not malformed" do login_as(default_user) + story = create(:story) params = { is_read: true }.to_json - headers = { "CONTENT_TYPE" => "application/json" } - expect { put("/stories/#{story_one.id}", params:, headers:) } - .to change_record(story_one, :is_read).from(false).to(true) + expect { put("/stories/#{story.id}", params:, headers:) } + .to change_record(story, :is_read).from(false).to(true) end it "marks a story as read when is_read is malformed" do login_as(default_user) + story = create(:story) params = { is_read: "malformed" }.to_json - headers = { "CONTENT_TYPE" => "application/json" } - expect { put("/stories/#{story_one.id}", params:, headers:) } - .to change_record(story_one, :is_read).from(false).to(true) + expect { put("/stories/#{story.id}", params:, headers:) } + .to change_record(story, :is_read).from(false).to(true) end it "marks a story as keep unread when it keep_unread not malformed" do login_as(default_user) + story = create(:story) params = { keep_unread: true }.to_json - headers = { "CONTENT_TYPE" => "application/json" } - expect { put("/stories/#{story_one.id}", params:, headers:) } - .to change_record(story_one, :keep_unread).from(false).to(true) + expect { put("/stories/#{story.id}", params:, headers:) } + .to change_record(story, :keep_unread).from(false).to(true) end it "marks a story as keep unread when keep_unread is malformed" do login_as(default_user) + story = create(:story) params = { keep_unread: "malformed" }.to_json - headers = { "CONTENT_TYPE" => "application/json" } - expect { put("/stories/#{story_one.id}", params:, headers:) } - .to change_record(story_one, :keep_unread).from(false).to(true) + expect { put("/stories/#{story.id}", params:, headers:) } + .to change_record(story, :keep_unread).from(false).to(true) end it "marks a story as starred when is_starred is not malformed" do login_as(default_user) + story = create(:story) params = { is_starred: true }.to_json - headers = { "CONTENT_TYPE" => "application/json" } - expect { put("/stories/#{story_one.id}", params:, headers:) } - .to change_record(story_one, :is_starred).from(false).to(true) + expect { put("/stories/#{story.id}", params:, headers:) } + .to change_record(story, :is_starred).from(false).to(true) end it "marks a story as starred when is_starred is malformed" do login_as(default_user) + story = create(:story) params = { is_starred: "malformed" }.to_json - headers = { "CONTENT_TYPE" => "application/json" } - expect { put("/stories/#{story_one.id}", params:, headers:) } - .to change_record(story_one, :is_starred).from(false).to(true) + expect { put("/stories/#{story.id}", params:, headers:) } + .to change_record(story, :is_starred).from(false).to(true) end end describe "#mark_all_as_read" do it "marks all unread stories as read and reload the page" do login_as(default_user) - stories = create_pair(:story, :unread) + stories = create_pair(:story) params = { story_ids: stories.map(&:id) } expect { post("/stories/mark_all_as_read", params:) } diff --git a/spec/requests/tutorials_controller_spec.rb b/spec/requests/tutorials_controller_spec.rb index 64fba0902..f5cc80b1a 100644 --- a/spec/requests/tutorials_controller_spec.rb +++ b/spec/requests/tutorials_controller_spec.rb @@ -3,9 +3,6 @@ RSpec.describe TutorialsController do describe "#index" do context "when a user has not been setup" do - let(:user) { instance_double(User) } - let(:feeds) { [instance_double(Feed), instance_double(Feed)] } - it "displays the tutorial and completes setup" do login_as(default_user) diff --git a/spec/system/stories_index_spec.rb b/spec/system/stories_index_spec.rb index 9ab48577d..6156df6ce 100644 --- a/spec/system/stories_index_spec.rb +++ b/spec/system/stories_index_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "stories/index" do it "displays the stories" do - create(:story, :unread, title: "My Story") + create(:story, title: "My Story") login_as(default_user) visit news_path @@ -20,7 +20,7 @@ end it "marks all stories as read" do - create(:story, :unread, title: "My Story") + create(:story, title: "My Story") login_as(default_user) visit news_path @@ -32,7 +32,7 @@ it "refreshes the page" do login_as(default_user) visit news_path - create(:story, :unread, title: "My Story") + create(:story, title: "My Story") click_on "Refresh" @@ -40,7 +40,7 @@ end it "displays the story body when the row is clicked" do - create(:story, :unread, title: "My Story", body: "My Body") + create(:story, title: "My Story", body: "My Body") login_as(default_user) visit news_path @@ -57,7 +57,7 @@ def star_story(story_title) end it "allows marking a story as starred" do - create(:story, :unread, title: "My Story") + create(:story, title: "My Story") login_as(default_user) star_story("My Story") @@ -67,7 +67,7 @@ def star_story(story_title) end it "allows marking a story as unstarred" do - create(:story, :unread, :starred, title: "My Story") + create(:story, :starred, title: "My Story") login_as(default_user) star_story("My Story") @@ -84,7 +84,7 @@ def mark_story_unread(story_title) end it "allows marking a story as unread" do - create(:story, :unread, :starred, title: "My Story") + create(:story, :starred, title: "My Story") login_as(default_user) mark_story_unread("My Story") @@ -94,7 +94,7 @@ def mark_story_unread(story_title) end it "allows viewing a story with hot keys" do - create(:story, :unread, title: "My Story", body: "My Body") + create(:story, title: "My Story", body: "My Body") login_as(default_user) visit news_path