Skip to content

Commit 2bef87e

Browse files
committed
test: Minor improvements to the dummy app
1 parent ab855b0 commit 2bef87e

14 files changed

Lines changed: 53 additions & 44 deletions

File tree

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Lint/MissingSuper:
2222
Lint/UnusedMethodArgument:
2323
AllowUnusedKeywordArguments: true
2424

25+
Naming/FileName:
26+
Exclude:
27+
- spec/dummy/db/*
28+
2529
RSpec/DescribeClass:
2630
Enabled: false
2731

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ console:
3838
lint:
3939
@docker compose -f extra/docker-compose.yml exec app_with_${DB} bin/rubocop
4040

41+
seed:
42+
@docker compose -f extra/docker-compose.yml exec app_with_${DB} bin/rails db:seed
43+
4144
server:
4245
@docker compose -f extra/docker-compose.yml exec app_with_${DB} bin/rails server -b 0.0.0.0 -p ${SERVER_PORT}
4346

spec/dummy/app/assets/images/.keep

Whitespace-only changes.

spec/dummy/app/channels/application_cable/channel.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

spec/dummy/app/channels/application_cable/connection.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

spec/dummy/app/helpers/application_helper.rb

Lines changed: 0 additions & 4 deletions
This file was deleted.

spec/dummy/app/mailers/application_mailer.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

spec/dummy/app/views/layouts/application.html.erb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,23 @@
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
<%= csrf_meta_tags %>
77
<%= csp_meta_tag %>
8+
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
10+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css">
11+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.css">
12+
13+
<style>
14+
form.button_to { display: inline-block; }
15+
.container { background: #fafafa; min-height: 100vh; }
16+
.listing { list-style: none; }
17+
.listing .button { margin-right: 5px; }
18+
.post svg { opacity: 0.5; width: 128px; height: 128px; }
19+
</style>
820
</head>
921

1022
<body>
11-
<%= yield %>
23+
<div class="container">
24+
<%= yield %>
25+
</div>
1226
</body>
1327
</html>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<div>
2-
<div class="item"><b>title</b>: <%= post.title %></div>
3-
<div class="item"><b>content</b>: <%= post.content %></div>
4-
<div class="item"><b>created_at</b>: <%= post.created_at %></div>
1+
<div class="post">
2+
<div class="item"><b>Title</b>: <%= post.title %></div>
3+
<div class="item"><b>Content</b>: <%= post.content %></div>
4+
<div class="item"><b>Created at</b>: <%= post.created_at %></div>
55
<% if post.some_file.attached? %>
66
<div class="item">
7-
<pre><%= post.some_file.download %></pre>
7+
<%== post.some_file.download %>
88
</div>
99
<% end %>
1010
</div>
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
<h1>Posts</h1>
22

3-
<ul>
3+
<ul class="listing">
44
<% @posts.each do |post| %>
55
<li>
6-
<%= post.title %><br/>
6+
<div>
7+
<b><%= post.title %></b>
8+
</div>
79
<% if post.content %>
8-
<%= post.content %><br/>
10+
<div>
11+
<%= post.content %>
12+
</div>
913
<% end %>
10-
<%= link_to 'Show', post, class: 'button button-outline' %>
11-
<%= link_to 'Edit', edit_post_path(post), class: 'button button-outline' %>
12-
<%= link_to 'Destroy', post, data: { confirm: 'Are you sure?' }, method: :delete, class: 'button button-outline' %>
14+
<%= link_to 'Show', post, class: 'button button-outline' %><%= link_to 'Edit', edit_post_path(post), class: 'button button-outline' %><%= button_to 'Destroy', post, data: { confirm: 'Are you sure?' }, method: :delete, class: 'button button-outline' %>
1315
</li>
1416
<% end %>
1517
</ul>
18+
19+
<hr/>
20+
21+
<div>
22+
<%= link_to 'New', new_post_path, class: 'button button-outline' %>
23+
</div>

0 commit comments

Comments
 (0)