tests working

This commit is contained in:
benji 2015-03-19 18:04:58 +01:00
parent a4245c1331
commit 46fd14a0a5
6 changed files with 18 additions and 25 deletions

View file

@ -1,16 +1,8 @@
<tr>
<td>
<%= user.id %>
</td>
<td>
<%= image_tag user.avatar(:small) %>
</td>
<td>
<%= user.nickname %>
</td>
<td>
<%= euro(user.debt) %>
</td>
<td><%= user.id %></td>
<td><%= image_tag user.avatar(:small) %></td>
<td><%= user.nickname %></td>
<td><%= euro(user.debt) %></td>
<% if current_user.admin? %>
<td>
<%= link_to "Delete", user_path(user), method: :delete, class: "btn btn-danger", data: { confirm: "Are you sure?" } %>

View file

@ -4,6 +4,13 @@
<%= render partial: 'flash' %>
<table id="users-table" class="table table-striped">
<tr>
<th>ID</th>
<th></th>
<th>Nickname</th>
<th>Debt</th>
<th></th>
</tr>
<%= render @users %>
</table>
</div>

View file

@ -1,10 +1,12 @@
<%= render partial: 'flash' %>
<div class="row">
<div class="user_info">
<h5>
<%= link_to "[Edit dagschotel]" , user_edit_dagschotel_path(@user) if current_user == @user %>
<%= link_to "[Edit profile]" , edit_user_registration_path if current_user == @user %>
</h5>
<% if current_user == @user %>
<h5>
<%= link_to "[Edit dagschotel]" , user_edit_dagschotel_path(@user) %>
<%= link_to "[Edit profile]" , edit_user_registration_path %>
</h5>
<% end %>
<h2><%= @user.nickname %></h2>
<%= button_to "PLACE ORDER!", new_user_order_path(@user), method: :get if current_user == @user %>
<div class="debt">DEBT: <%= euro(@user.debt) %></div>

View file

@ -75,7 +75,7 @@ end
50.times do |i|
User.create(
nickname: "TestUser#{i}",
nickname: "testUser#{i}",
avatar: users[0][:avatar],
password: DEFAULT_PASSWORD,
password_confirmation: DEFAULT_PASSWORD

View file

@ -30,14 +30,10 @@
benji:
nickname: benji
name: Benjamin
last_name: Cousaert
dagschotel_id: 1
iasoon:
nickname: iasoon
name: Ilion
last_name: Beyst
admin:
nickname: admin

View file

@ -33,10 +33,6 @@ class UserTest < ActiveSupport::TestCase
@user = users(:benji)
end
test "full name" do
assert_equal @user.full_name, "Benjamin Cousaert"
end
test "debt behaves correctly" do
assert_equal @user.debt_cents, 0
assert_equal @user.debt, 0