Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diaspora
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Milan
diaspora
Commits
a0e6433f
Commit
a0e6433f
authored
13 years ago
by
Dennis Collinson
Browse files
Options
Downloads
Patches
Plain Diff
test multiple file upload in cucumber
parent
60420f10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
features/step_definitions/trumpeter_steps.rb
+13
-3
13 additions, 3 deletions
features/step_definitions/trumpeter_steps.rb
features/trumpeter.feature
+10
-7
10 additions, 7 deletions
features/trumpeter.feature
with
23 additions
and
10 deletions
features/step_definitions/trumpeter_steps.rb
+
13
−
3
View file @
a0e6433f
...
...
@@ -41,13 +41,23 @@ Then /^"([^"]*)" should be a (limited|public) post in my stream$/ do |post_text,
end
When
/^I upload a fixture picture with filename "([^"]*)"$/
do
|
file_name
|
orig_photo_count
=
all
(
".photos img"
).
size
within
".new_photo"
do
attach_file
"photo[user_file]"
,
Rails
.
root
.
join
(
"spec"
,
"fixtures"
,
file_name
)
wait_until
{
all
(
".photos img"
).
size
==
orig_photo_count
+
1
}
end
@image_source
=
find
(
".photos img"
)[
"src"
]
@image_sources
||=
{}
@image_sources
[
file_name
]
=
all
(
".photos img"
).
last
[
"src"
]
@image_sources
[
file_name
].
should
be_present
end
Then
/^"([^"]*)" should have the "([^"]*)" picture$/
do
|
post_text
,
file_name
|
image
=
find_post_by_text
(
post_text
).
find
(
".photo_attachments img[src='
#{
@image_sources
[
file_name
]
}
']"
)
image
.
should
be_present
end
Then
/^"([^"]*)" should have
my photo$/
do
|
status_text
|
find_post_by_text
(
st
atus
_text
).
find
(
".photo_attachments img"
)
[
"src"
]
.
should
==
@image_source
Then
/^"([^"]*)" should have
(\d+) pictures$/
do
|
post_text
,
number_of_pictures
|
find_post_by_text
(
po
st_text
).
all
(
".photo_attachments img"
)
.
size
.
should
==
number_of_pictures
.
to_i
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
features/trumpeter.feature
+
10
−
7
View file @
a0e6433f
...
...
@@ -5,13 +5,15 @@ Feature: Creating a new post
And
I sign in as
"bob@bob.bob"
And
I trumpet
Scenario
:
Posting a public message
And
I write
"
Rectangles are awesome
"
Scenario
:
Posting a public message
with a photo
And
I write
"
I love RMS
"
When
I select
"Public"
in my aspects dropdown
And
I upload a fixture picture with filename
"button.gif"
When
I press
"Share"
When
I go to
"/stream"
Then
I should see
"Rectangles are awesome"
as the first post in my stream
And
"Rectangles are awesome"
should be a public post in my stream
Then
I should see
"I love RMS"
as the first post in my stream
And
"I love RMS"
should be a public post in my stream
Then
"I love RMS"
should have the
"button.gif"
picture
Scenario
:
Posting to Aspects
And
I write
"This is super skrunkle"
...
...
@@ -29,9 +31,10 @@ Feature: Creating a new post
And
I go to
"/stream"
Then
I follow
"Alice Smith"
Scenario
:
Uploading a photo
When
I write
"check out this picture"
Scenario
:
Uploading multiple photos
When
I write
"check out these pictures"
And
I upload a fixture picture with filename
"button.gif"
And
I upload a fixture picture with filename
"button.gif"
And
I press
"Share"
And
I go to
"/stream"
Then
"check out th
is
picture"
should have
my photo
Then
"check out th
ese
picture
s
"
should have
2 pictures
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment