Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PropTrackr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
kerdo
PropTrackr
Commits
9a35007c
Commit
9a35007c
authored
4 months ago
by
Kerdo Kurs
Browse files
Options
Downloads
Patches
Plain Diff
finish BDD
#18
parent
d339ea9c
No related branches found
No related tags found
1 merge request
!13
Resolve "FR-08: Create Property Advertisement" and "FR-07: View Properties (Unauthenticated)"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
features/advertisement_creation.feature
+6
-0
6 additions, 0 deletions
features/advertisement_creation.feature
features/contexts/advertisement_creation_context.exs
+20
-0
20 additions, 0 deletions
features/contexts/advertisement_creation_context.exs
with
26 additions
and
0 deletions
features/advertisement_creation.feature
+
6
−
0
View file @
9a35007c
...
...
@@ -27,3 +27,9 @@ Feature: FR-08 Property Advertisement Creation
When
I click submit
Then
I should see error messages
And
I should still see the new property advertisement form
Scenario
:
Unauthenticated user should not be able to create an advertisement
Given
I am not logged in
And
I would like to create a new property advertisement
Then
I should not see a link to create a new property advertisement
And
I should be redirected back to home page when I try to access the link
This diff is collapsed.
Click to expand it.
features/contexts/advertisement_creation_context.exs
+
20
−
0
View file @
9a35007c
...
...
@@ -113,6 +113,26 @@ defmodule AdvertisementCreationContext do
{
:ok
,
state
}
end
given_
~r/^I am not logged in$/
,
fn
state
->
navigate_to
(
"/logout"
)
{
:ok
,
state
}
end
and_
~r/^I would like to create a new property advertisement$/
,
fn
state
->
navigate_to
(
"/"
)
{
:ok
,
state
}
end
then_
~r/^I should not see a link to create a new property advertisement$/
,
fn
state
->
assert
not
visible_in_page?
~r/Add a new property listing/
{
:ok
,
state
}
end
and_
~r/^I should be redirected back to home page when I try to access the link$/
,
fn
state
->
assert
current_path
()
==
"/"
{
:ok
,
state
}
end
defp
setup_session
(
email
,
password
)
do
navigate_to
(
"/login"
)
fill_field
({
:id
,
"email"
},
email
)
...
...
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