Skip to content

Commit 3692785

Browse files
committed
Fix tests by further removing dead code
1 parent 053a8e3 commit 3692785

12 files changed

Lines changed: 10 additions & 68 deletions

File tree

app/services/reports/data_export_service.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'zip'
2+
13
class Reports::DataExportService
24
attr_reader :provider, :type, :period
35

app/views/notification_mailer/post_created.html.slim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ p
77
- else
88
p
99
| Anonymous user has posted a new message in your forum
10-
11-
p= link_to 'View new forum post', forum_topic_url(@post.topic, host: @provider_account.external_domain)

app/views/notification_mailer/post_created.text.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ Dear <%= @receiver.informal_name %>,
44
<% else %>
55
Anonymous user has posted a new message in your forum
66
<% end %>
7-
To view new forum post, follow this link <%= forum_topic_url(@post.topic, host: @provider_account.external_domain) %>

app/views/topic_mailer/new_post.text.erb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ A new post has been posted in the thread <%= h @post.topic.title %>
55
Post:
66
<%= truncate h(@post.body), :length => 300 %>
77

8-
Read more: <%= forum_topic_url(:id => @post.topic, :host => @domain) -%>
9-
108
The 3SCALE Developer Team

features/step_definitions/navigation_steps.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
click_link href: admin_buyers_accounts_path
1010
end
1111

12-
# TODO: THREESCALE-8033 Remove this step as it's no longer in use.
13-
When "I navigate to a topic in the forum of {forum}" do |forum|
14-
visit forum_path
15-
click_link forum.topics.first.title
16-
end
17-
18-
When "I should not see forum" do
19-
visit forum_path
20-
assert_text "Page not found"
21-
end
22-
2312
When "I navigate to the {application} of the partner {string}" do |app, partner|
2413
click_link(href: admin_buyers_accounts_path)
2514
click_link partner

features/support/paths.rb

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -122,22 +122,6 @@ def path_to(page_name, *args) # rubocop:disable Metrics/AbcSize, Metrics/Cycloma
122122

123123
admin_messages_trash_path(message)
124124

125-
#
126-
# Forum
127-
#
128-
when 'forum settings',
129-
'the forum settings page'
130-
edit_admin_site_forum_path
131-
132-
when 'the forum page'
133-
forum_path
134-
when 'the new topic page'
135-
new_forum_topic_path
136-
when /^the "([^"]*)" topic page$/
137-
forum_topic_path(Topic.find_by_title!($1))
138-
when 'the forum subscriptions page'
139-
forum_subscriptions_path
140-
141125
#
142126
# Logged in
143127
#
@@ -532,22 +516,6 @@ def path_to(page_name, *args) # rubocop:disable Metrics/AbcSize, Metrics/Cycloma
532516
when /^the data exports page$/
533517
new_admin_data_exports_path
534518

535-
#
536-
# Forum admin
537-
#
538-
when 'the admin portal forum page'
539-
admin_forum_path
540-
when 'the admin portal new topic page'
541-
new_admin_forum_topic_path
542-
when /^the admin portal "([^"]*)" topic page$/
543-
admin_forum_topic_path(Topic.find_by_title!($1))
544-
when /^the admin portal edit "([^"]*)" topic page$/
545-
edit_admin_forum_topic_path(Topic.find_by_title!($1))
546-
when 'the admin portal forum categories page'
547-
admin_forum_categories_path
548-
when 'the admin portal new forum category page'
549-
new_admin_forum_category_path
550-
551519
#
552520
# Site settings
553521
#
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
<% if site_account.forum && site_account.forum.posts.size > 0 %>
22
<div class="dashboard_card round">
33
<h3>Latest Forum Activity</h3>
4-
5-
<ul class="latest-forum-posts">
6-
<%- site_account.forum.posts.order(created_at: :desc).limit(5).each do |post| -%>
7-
<li>
8-
New
9-
<%= link_to 'post',
10-
main_app.forum_topic_path(post.topic, :anchor => "post_#{post.id}") %>
11-
on topic <%= link_to post.topic.title, main_app.forum_topic_path(post.topic) %>
12-
</li>
13-
<%- end -%>
14-
</ul>
154
</div>
165
<%- end -%>

lib/developer_portal/lib/liquid/drops/post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def created_at
2424

2525
desc "The URL of this post within its topic."
2626
def url
27-
System::UrlHelpers.system_url_helpers.forum_topic_path(@model.topic, anchor: "post_#{@model.id}")
27+
""
2828
end
2929
end
3030
end

lib/developer_portal/lib/liquid/drops/topic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def title
1010
end
1111

1212
def url
13-
System::UrlHelpers.system_url_helpers.forum_topic_path(@model)
13+
''
1414
end
1515
end
1616
end

test/integration/sessions_test.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def setup
5959
format: :xml,
6060
provider_key: @provider.api_key,
6161
user_id: user_id,
62-
username: user.username,
63-
redirect_url: forum_path(host: @provider.internal_domain)
62+
username: user.username
6463
}
6564

6665
assert_response :created
@@ -117,7 +116,7 @@ def setup
117116

118117
host! @provider.internal_domain
119118

120-
get developer_portal.create_session_url(username: user.username, password: 'superSecret1234#', redirect_url: forum_url(host: @provider.internal_domain))
119+
get developer_portal.create_session_url(username: user.username, password: 'superSecret1234#', redirect_url: developer_portal.login_url(host: @provider.internal_domain))
121120
follow_redirect!
122121

123122
assert_equal root_path, path
@@ -131,10 +130,10 @@ def setup
131130

132131
host! @provider.internal_domain
133132

134-
get developer_portal.create_session_url(token: 'yabadabado', expires_at: '2016', redirect_url: forum_url(host: @provider.internal_domain))
133+
get developer_portal.create_session_url(token: 'yabadabado', expires_at: '2016', redirect_url: developer_portal.login_url(host: @provider.internal_domain))
135134
follow_redirect!
136135

137-
assert_equal forum_path, path
136+
assert_equal developer_portal.login_path, path
138137
end
139138

140139
test 'passing redirect_to to login form' do

0 commit comments

Comments
 (0)