Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
9da8f322
Commit
9da8f322
authored
Jul 22, 2010
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added s3 feature, renamed the basic feature
parent
12745c45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
features/basic.feature
+0
-0
features/s3.feature
+43
-0
No files found.
features/
rails
.feature
→
features/
basic
.feature
View file @
9da8f322
File moved
features/s3.feature
0 → 100644
View file @
9da8f322
Feature
:
Running paperclip in a Rails app using basic S3 support
Scenario
:
Basic utilization
Given
I generate a rails application
And I have a "users" resource with "name
:
string"
And
I run
"script/generate paperclip user avatar"
And
I save the following as
"app/models/user.rb"
"""
class User < ActiveRecord::Base
has_attached_file :avatar,
:storage => :s3,
:bucket => "jyurek",
:s3_credentials => "config/s3.yml"
end
"""
And
I save the following as
"config/s3.yml"
"""
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
bucket: paperclip
"""
And
I save the following as
"app/views/users/new.html.erb"
"""
<% form_for @user, :html => { :multipart => true } do |f| %>
<%= f.text_field :name %>
<%= f.file_field :avatar %>
<%= submit_tag "Submit" %>
<% end %>
"""
And
I save the following as
"app/views/users/show.html.erb"
"""
<p>Name: <%= @user.name %></p>
<p>Avatar: <%= image_tag @user.avatar.url %></p>
"""
And
this plugin is available
And
the rails application is prepped and running
When
I visit /users/new
And
I fill in
"user_name"
with
"something"
And
I attach the file
"test/fixtures/5k.png"
to
"user_avatar"
And
I press
"Submit"
Then I should see "Name
:
something"
And I should see an image with a path of "http
:
//paperclip.s3.amazonaws.com/system/avatars/1/original/5k.png"
And the file at "http
:
//paperclip.s3.amazonaws.com/system/avatars/1/original/5k.png"
is
the
same
as
"test/fixtures/5k.png"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment