Skip to content

Commit 62fe0b8

Browse files
committed
test(collection/remove-series): add integration test for removing series from user's collection
Fix #45
1 parent 26dbbda commit 62fe0b8

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

src/main/resources/liquibase/version/0.4.1.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
<include file="0.4.1/2019-07-21--series_sales_transaction_url_length.xml" relativeToChangelogFile="true"/>
99
<include file="0.4.1/2019-08-06--test_user_with_series_in_collection.xml" relativeToChangelogFile="true"/>
10-
10+
1111
</databaseChangeLog>

src/main/resources/liquibase/version/0.4.1/2019-08-06--test_user_with_series_in_collection.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">
77

88
<changeSet id="create-a-user-with-a-series-in-his-collection" author="mukeshk" context="test-data">
9-
<comment>Creates the user "seriesowner" that has series #1 in its collection</comment>
9+
<comment>Creates the user "seriesowner" that has series #1 and #2 in its collection</comment>
1010
<insert tableName="users">
1111
<column name="login" value="seriesowner" />
1212
<column name="role" value="USER" />
@@ -30,6 +30,12 @@
3030
<column name="series_id" value="1" />
3131
<column name="number_of_stamps" value="1" />
3232
</insert>
33+
34+
<insert tableName="collections_series">
35+
<column name="collection_id" valueComputed="(SELECT id FROM collections WHERE slug = 'seriesowner')" />
36+
<column name="series_id" valueNumeric="2" />
37+
<column name="number_of_stamps" valueNumeric="3" />
38+
</insert>
3339
</changeSet>
3440

3541
</databaseChangeLog>

src/main/webapp/WEB-INF/views/series/info.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ <h5 class="text-center" th:text="#{t_similar_series}">
439439

440440
<!--/*/
441441
<div class="col-sm-12" th:if="${isSeriesInCollection}" sec:authorize="hasAuthority('UPDATE_COLLECTION')">
442-
<form method="post" action="../collection/info.html" th:action="@{${INFO_SERIES_PAGE}(id=${series.id})}">
442+
<form id="remove-series-form" method="post" action="../collection/info.html" th:action="@{${INFO_SERIES_PAGE}(id=${series.id})}">
443443
<p th:text="#{t_series_in_collection}">
444444
Series is part of your collection
445445
</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
*** Settings ***
2+
Documentation Verify add series to user's collection
3+
Library SeleniumLibrary
4+
Resource ../../auth.steps.robot
5+
Suite Setup Before Test Suite
6+
Suite Teardown Close Browser
7+
Force Tags collection series logic testme
8+
9+
*** Test Cases ***
10+
Remove a series from user's collection
11+
[Tags] unstable
12+
Go To ${SITE_URL}/series/2
13+
Submit Form id=remove-series-form
14+
Page Should Not Contain Link css=[href="/series/2"]
15+
16+
*** Keywords ***
17+
Before Test Suite
18+
Open Browser ${SITE_URL}/account/auth ${BROWSER}
19+
Register Keyword To Run On Failure Log Source
20+
Log In As login=seriesowner password=test

0 commit comments

Comments
 (0)