-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting up to date - unknown changes
- Loading branch information
1 parent
48d41b3
commit 34390c3
Showing
7 changed files
with
78 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Base image | ||
FROM ruby:2.7 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y nodejs | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install | ||
|
||
# Copy application files | ||
COPY . . | ||
|
||
# Start Rails server | ||
CMD ["rails", "server", "-b", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
#As an authenticated user | ||
#I want to be able to access a file upload page | ||
#So that I can upload my photographs | ||
# | ||
#AC: Upload form must be visible to photographer | ||
# | ||
# | ||
# | ||
#As a authenticated user | ||
#I want to be able to upload photographs | ||
#So that I can upload my photographs | ||
# | ||
#AC: The selected photographs should be uploaded to the server | ||
#As a authenticated user | ||
#I want to be able to see my uploaded photos | ||
#So that I can verify that uploaded process was successfully completed | ||
# | ||
#AC: Server should list those photographs as part of the session | ||
#As a authenticated user | ||
#I want to be able to access a file upload page | ||
#So that I can upload my photographs | ||
# | ||
#AC: Photographs should be served as public images available for purchase | ||
# | ||
Feature: User properly uploads photos and records sales | ||
As a visitor to the website I want to see sessions created by photographer users and I want to be able to purchase photographs | ||
|
||
Background: User is Logged In | ||
Given Coco exists as a user | ||
And Coco signs in with valid credentials | ||
|
||
Scenario: Coco should be able to view their own photos | ||
When Coco creates a new session with photos | ||
And Coco visits that session page | ||
Then Coco should see the photos | ||
|
||
Scenario: Strangers should be able to view user photos | ||
When Coco creates a new session with photos | ||
And Stranger visits that session page | ||
Then Stranger should see the photos | ||
|
||
Scenario: The session should be associated with the photos | ||
When Coco creates a new session with photos | ||
And Sally visits that session page | ||
And Sally clicks on the image intending to buy | ||
And Sally clicks the buy button | ||
Then Sally should be redirected to the stripe payment gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Given '{word} creates a new session with photos' do |username| | ||
visit new_session_path | ||
within '#new_session' do | ||
fill_in 'session_title', with: 'The title of this test session' | ||
fill_in 'session_description', with: 'some test description' | ||
fill_in 'session_default_price', with: '2.22' | ||
attach_file("session_images", Rails.root + "test/fixtures/images/surf-photo-1.jpeg") | ||
end | ||
click_on "Save" | ||
@session = Session.last | ||
end | ||
|
||
When '{word} visits that session page' do |username| | ||
visit session_path @session | ||
end | ||
|
||
Then '{word} should see the photos' do |username| | ||
expect(@session.id.to_s).to eq(page.current_url.split('/')[-1]) | ||
# page.html.should have_content 'charges/new' | ||
end | ||
|
||
When('{word} clicks on the image intending to buy') do |username| | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end | ||
|
||
When('{word} clicks the buy button') do |username| | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end | ||
|
||
Then('{word} should be redirected to the stripe payment gateway') do |username| | ||
pending # Write code here that turns the phrase above into concrete actions | ||
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.