Skip to content

Commit

Permalink
Specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk committed Oct 11, 2024
1 parent 07b228e commit 7a5b1e8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/javascript/components/Shows.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Shows = ({ shows, numbering = false, tourHeaders = false }) => {
<CoverArt coverArtUrls={show.cover_art_urls} />
{formatDateMed(show.date)}
</span>
<span className="leftside-secondary">{show.venue.name}</span>
<span className="leftside-secondary">{show.venue_name}</span>
<span className="leftside-tertiary">
<TagBadges tags={show.tags} parentId={show.date} />
</span>
Expand Down
4 changes: 2 additions & 2 deletions spec/features/era_shows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
visit "/2024"

shows.each do |show|
expect(page).to have_content(show.date.to_s.gsub("-", "."))
expect(page).to have_content(show.venue.name)
expect(page).to have_content(show.date.strftime("%b %-d, %Y"))
expect(page).to have_content(show.venue_name)
end
end

Expand Down
3 changes: 3 additions & 0 deletions spec/features/homepage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
expect(page).to have_link("Playlists", href: "/playlists")
expect(page).to have_link("Top 46 Shows", href: "/top-shows")
expect(page).to have_link("Top 46 Tracks", href: "/top-tracks")

find("#nav-search").click # Close the dropdown
end

within("#sidebar") do
Expand Down Expand Up @@ -81,6 +83,7 @@

# Click most recent year
click_on(most_recent_year)
sleep 1
expect(page).to have_current_path("/#{most_recent_year}")
within("#sidebar") do
expect(page).to have_content(most_recent_year)
Expand Down
8 changes: 4 additions & 4 deletions spec/features/my_shows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
expect(page).to have_current_path("/my-shows")
expect(page).to have_content("My Shows")
shows.sort_by(&:date).reverse.each_with_index do |show, idx|
expect(page).to have_content(show.date.to_s.gsub("-", "."))
expect(page).to have_content(show.venue.name)
expect(page).to have_content(show.date.strftime("%b %-d, %Y"))
expect(page).to have_content(show.venue_name)
end
end

Expand All @@ -30,8 +30,8 @@
select "Sort by Likes (High to Low)", from: "sort"
sorted_shows = shows.sort_by { |show| show.likes.count }.reverse
sorted_shows.each_with_index do |show, idx|
expect(page).to have_content(show.date.to_s.gsub("-", "."))
expect(page).to have_content(show.venue.name)
expect(page).to have_content(show.date.strftime("%b %-d, %Y"))
expect(page).to have_content(show.venue_name)
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/features/my_tracks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
expect(page).to have_current_path("/my-tracks")
expect(page).to have_content("My Tracks")
tracks.sort_by { _1.show.date }.reverse.each_with_index do |track, idx|
expect(page).to have_content(track.show.date.to_s.gsub("-", "."))
expect(page).to have_content(track.show.date.strftime("%b %-d, %Y"))
expect(page).to have_content(track.title)
end
end
Expand All @@ -31,7 +31,7 @@
select "Sort by Likes (High to Low)", from: "sort"
sorted_tracks = tracks.sort_by { _1.likes.count }.reverse
sorted_tracks.each_with_index do |track, idx|
expect(page).to have_content(track.show.date.to_s.gsub("-", "."))
expect(page).to have_content(track.show.date.strftime("%b %-d, %Y"))
expect(page).to have_content(track.title)
end
end
Expand All @@ -41,7 +41,7 @@
select "Sort by Duration (Longest First)", from: "sort"
sorted_tracks = tracks.sort_by(&:duration).reverse
sorted_tracks.each_with_index do |track, idx|
expect(page).to have_content(track.show.date.to_s.gsub("-", "."))
expect(page).to have_content(track.show.date.strftime("%b %-d, %Y"))
expect(page).to have_content(track.title)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/tags_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

first(".list-item", text: tag_1.name).find("a", text: "2 shows").click
expect(page).to have_current_path("/show-tags/#{tag_1.slug}")
expect(page).to have_css(".list-item", text: show.date.to_s.gsub("-", "."))
expect(page).to have_css(".list-item", text: show.date.strftime("%b %-d, %Y"))
end

it "navigates to track tag page and displays correct track count" do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/top_shows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

shows.sort_by { |show| show.likes.count }.reverse.each_with_index do |show, idx|
within all(".list-item")[idx] do
expect(page).to have_css(".leftside-primary", text: show.date.to_s.gsub("-", "."))
expect(page).to have_css(".leftside-primary", text: show.date.strftime("%b %-d, %Y"))
expect(page).to have_css(".leftside-secondary", text: show.venue_name)
within(".like-container") do
expect(page).to have_content(show.likes_count)
Expand Down

0 comments on commit 7a5b1e8

Please sign in to comment.