Permalink
Browse files

specs cleanup: better naming, organizaiton, and setup technique

  • Loading branch information...
pugetive committed Dec 6, 2017
1 parent c4d2f23 commit d30772d713872ba50a4dbf3a9a015e5de776a74f
@@ -2,6 +2,7 @@
factory :song do
name "Placeholder Song Name"
interest_id MUSIC_INTEREST_ID
start_year Time.now.year.to_i - 5
end
end
@@ -0,0 +1,84 @@
require 'rails_helper'
feature "Viewing sofware app pages" do
before(:each) do
prepare_pugetive
prepare_software
end
scenario "as a regular visitor" do
apps = App.random(3)
expect(apps.size).to eq 3
apps.each do |app|
visit app_path(app)
expect(page).to have_content app.name
# expect(page).to have_content '<h1>Software</h1>'
end
end
end
feature "Viewing songs pages" do
before(:each) do
prepare_pugetive
prepare_music
end
scenario "as a regular visitor" do
songs = Song.random(3)
expect(songs.size).to eq 3
songs.each do |song|
visit song_path(song)
expect(page).to have_content song.name
end
end
end
feature "Viewing photo pages" do
before(:each) do
prepare_pugetive
prepare_photography
end
scenario "as a regular visitor" do
photos = Photo.random(3)
expect(photos.size).to eq 3
photos.each do |photo|
visit photo_path(photo)
expect(page).to have_content photo.name
end
end
end
feature "Viewing film show pages" do
before(:each) do
prepare_pugetive
prepare_film
end
scenario "as a regular visitor" do
movies = Movie.random(3)
expect(movies.size).to eq 3
movies.each do |movie|
visit movie_path(movie)
expect(page).to have_content movie.name
end
end
end
feature "Viewing writing piece pages" do
before(:each) do
prepare_pugetive
prepare_writing
end
scenario "as a regular visitor" do
pieces = Piece.random(3)
expect(pieces.size).to eq 3
pieces.each do |piece|
visit piece_path(piece)
expect(page).to have_content piece.name
end
end
end
@@ -0,0 +1,104 @@
require 'rails_helper'
feature "Viewing homepage" do
before(:each) do
prepare_pugetive
end
scenario "as an anonymous browser" do
prepare_photography
visit '/'
expect(page).to have_content 'Photography'
end
end
feature "Viewing resumes" do
scenario "downloading the public resume as a regular visitor"
scenario "generating a new resume as admin"
end
feature "Viewing main software page" do
before(:each) do
prepare_pugetive
end
scenario "as an anonymous browser" do
prepare_software
visit "/software"
expect(page).to have_content /amazon/
end
end
feature "Viewing main music page" do
before(:each) do
prepare_pugetive
end
scenario "as an anonymous browser" do
prepare_music
visit "/music"
expect(page).to have_content 'Lushy'
end
end
feature "Viewing main photography page" do
before(:each) do
prepare_pugetive
end
scenario "as an anonymous browser" do
prepare_photography
visit '/photography'
expect(page).to have_content 'Street'
expect(page).to have_content 'Instagram'
expect(page).to have_content 'Flickr'
end
end
feature "Viewing main film page" do
before(:each) do
prepare_pugetive
end
scenario "as an anonymous browser" do
prepare_film
visit '/film'
expect(page).to have_content 'Documentary'
end
end
feature "visiting main writing page" do
before(:each) do
prepare_pugetive
end
scenario "as an anonymous browser" do
prepare_writing
visit '/writing'
expect(page).to have_content 'Haiku'
end
end

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,21 @@
require 'rails_helper'
feature "Viewing title show pages" do
before(:each) do
prepare_pugetive
end
scenario "as a regular visitor" do
prepare_software
prepare_music
titles = Title.random(3)
expect(titles.size).to eq 3
titles.each do |title|
visit title_path(title)
expect(page).to have_content title.name
end
end
end

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,30 @@
require 'rails_helper'
feature "Tools management" do
before(:each) do
prepare_pugetive
end
scenario "destroying a tool should redirect back to index page"
end
feature "Viewing tool show pages" do
before(:each) do
prepare_pugetive
end
scenario "as a regular visitor" do
prepare_software
prepare_music
tools = Tool.random(3)
expect(tools.size).to eq 3
tools.each do |tool|
visit tool_path(tool)
expect(page).to have_content tool.name
end
end
end
Oops, something went wrong.

0 comments on commit d30772d

Please sign in to comment.