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
43f5d4f8
Commit
43f5d4f8
authored
Apr 14, 2012
by
Mark Kremer
Committed by
Mike Burns
May 31, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a basic cucumber feature that shows that the Railtie configuration works
parent
efead1a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
features/basic_integration.feature
+19
-0
features/step_definitions/rails_steps.rb
+8
-0
No files found.
features/basic_integration.feature
View file @
43f5d4f8
...
@@ -24,6 +24,25 @@ Feature: Rails integration
...
@@ -24,6 +24,25 @@ Feature: Rails integration
And
I should see an image with a path of
"/system/attachments/original/5k.png"
And
I should see an image with a path of
"/system/attachments/original/5k.png"
And
the file at
"/system/attachments/original/5k.png"
should be the same as
"test/fixtures/5k.png"
And
the file at
"/system/attachments/original/5k.png"
should be the same as
"test/fixtures/5k.png"
Scenario
:
Configure defaults for all attachments through Railtie
Given I add this snippet to config/application.rb
:
"""
config.paperclip_defaults = {:url => "/paperclip/custom/:attachment/:style/:filename"}
"""
Given I add this snippet to the User model
:
"""
attr_accessible :name, :attachment
has_attached_file :attachment
"""
And
I start the rails application
When
I go to the new user page
And
I fill in
"Name"
with
"something"
And
I attach the file
"test/fixtures/5k.png"
to
"Attachment"
And
I press
"Submit"
Then I should see "Name
:
something"
And
I should see an image with a path of
"/paperclip/custom/attachments/original/5k.png"
And
the file at
"/paperclip/custom/attachments/original/5k.png"
should be the same as
"test/fixtures/5k.png"
Scenario
:
S3 Integration test
Scenario
:
S3 Integration test
Given I add this snippet to the User model
:
Given I add this snippet to the User model
:
"""
"""
...
...
features/step_definitions/rails_steps.rb
View file @
43f5d4f8
...
@@ -65,6 +65,14 @@ Given /^I add this snippet to the User model:$/ do |snippet|
...
@@ -65,6 +65,14 @@ Given /^I add this snippet to the User model:$/ do |snippet|
end
end
end
end
Given
/^I add this snippet to config\/application.rb:$/
do
|
snippet
|
file_name
=
"config/application.rb"
in_current_dir
do
content
=
File
.
read
(
file_name
)
File
.
open
(
file_name
,
'w'
)
{
|
f
|
f
<<
content
.
sub
(
/class Application < Rails::Application.*$/
,
"class Application < Rails::Application
\n
#{
snippet
}
\n
"
)}
end
end
Given
/^I start the rails application$/
do
Given
/^I start the rails application$/
do
in_current_dir
do
in_current_dir
do
require
"./config/environment"
require
"./config/environment"
...
...
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