Fix codestyle of announcement controller spec

This commit is contained in:
Andreas Nedbal 2022-01-25 22:09:07 +01:00 committed by Andreas Nedbal
parent a28f581aed
commit c2b448ae8c
1 changed files with 21 additions and 22 deletions

View File

@ -24,7 +24,7 @@ describe AnnouncementController, type: :controller do
end
context "one announcement" do
let!(:announcement) { Announcement.create(content: "I am announcement", user: user, starts_at: Time.current, ends_at: Time.current + 2.days) }
let!(:announcement) { Announcement.create(content: "I am announcement", user: user, starts_at: Time.current, ends_at: 2.days.from_now) }
it "includes the announcement in the @announcements assign" do
subject
@ -53,7 +53,7 @@ describe AnnouncementController, type: :controller do
announcement: {
content: "I like dogs!",
starts_at: Time.current,
ends_at: Time.current + 2.days
ends_at: 2.days.from_now
}
}
end
@ -81,7 +81,7 @@ describe AnnouncementController, type: :controller do
announcement: {
content: "I like dogs!",
starts_at: Time.current,
ends_at: Time.current - 2.days
ends_at: 2.days.ago
}
}
end
@ -96,8 +96,8 @@ describe AnnouncementController, type: :controller do
describe "#edit" do
let! :announcement do
Announcement.create(content: "Dogs are pretty cool, I guess",
starts_at: Time.current + 3.days,
ends_at: Time.current + 10.days,
starts_at: 3.days.from_now,
ends_at: 10.days.from_now,
user: user)
end
@ -122,8 +122,8 @@ describe AnnouncementController, type: :controller do
let! :announcement do
Announcement.create(content: "Dogs are pretty cool, I guess",
starts_at: Time.current + 3.days,
ends_at: Time.current + 10.days,
starts_at: 3.days.from_now,
ends_at: 10.days.from_now,
user: user)
end
@ -156,7 +156,7 @@ describe AnnouncementController, type: :controller do
{
content: "I like dogs!",
starts_at: Time.current,
ends_at: Time.current - 2.days
ends_at: 2.days.ago
}
end
@ -177,8 +177,8 @@ describe AnnouncementController, type: :controller do
describe "#destroy" do
let! :announcement do
Announcement.create(content: "Dogs are pretty cool, I guess",
starts_at: Time.current + 3.days,
ends_at: Time.current + 10.days,
starts_at: 3.days.from_now,
ends_at: 10.days.from_now,
user: user)
end
@ -198,4 +198,3 @@ describe AnnouncementController, type: :controller do
end
end
end