Skip to content

Commit 6acbb16

Browse files
committed
Move profile deletion prompt below repositories
1 parent 33b5c52 commit 6acbb16

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

app/views/profiles/user.erb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@
8585
</div>
8686
</section>
8787

88+
<section class="profile-section profile-section--alt" aria-labelledby="profile-repositories-heading">
89+
<div class="content">
90+
<h2 id="profile-repositories-heading"><%= h t('users.repositories.title') %></h2>
91+
<%= erb :"profiles/repository_grid", locals: {
92+
repositories: @repositories,
93+
empty_translation_key: 'users.repositories.empty',
94+
path_builder: method(:repository_profile_path),
95+
show_homepage: true
96+
} %>
97+
</div>
98+
</section>
99+
88100
<% if @show_profile_delete_control %>
89101
<section class="profile-section profile-delete-section" aria-labelledby="profile-delete-heading">
90102
<div class="content profile-delete">
@@ -106,16 +118,4 @@
106118
</div>
107119
</section>
108120
<% end %>
109-
110-
<section class="profile-section profile-section--alt" aria-labelledby="profile-repositories-heading">
111-
<div class="content">
112-
<h2 id="profile-repositories-heading"><%= h t('users.repositories.title') %></h2>
113-
<%= erb :"profiles/repository_grid", locals: {
114-
repositories: @repositories,
115-
empty_translation_key: 'users.repositories.empty',
116-
path_builder: method(:repository_profile_path),
117-
show_homepage: true
118-
} %>
119-
</div>
120-
</section>
121121
<% end %>

spec/polish_open_source_rank/web/app_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,10 @@ def user(_access_token)
560560
user = bootstrapped_database(database_path).dataset(:users).where(platform: 'github', login: 'alice').first
561561

562562
expect(profile.body).to include('Chcesz usunąć tę stronę z bazy danych? Kliknij')
563+
repositories_heading_index = profile.body.index('Najlepsze projekty')
564+
deletion_prompt_index = profile.body.index('Chcesz usunąć tę stronę z bazy danych? Kliknij')
565+
566+
expect(repositories_heading_index).to be < deletion_prompt_index
563567
expect(profile.body).to include('Czy na pewno chcesz usunąć twój profil z bazy danych?')
564568
expect(invalid_delete.status).to eq(403)
565569
expect(delete.status).to eq(303)

0 commit comments

Comments
 (0)