This repository has been archived by the owner on Jun 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
87 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
<h1>Role index</h1> | ||
<div class="col-md-6 col-md-offset-3"> | ||
<% @roles.each do |role| %> | ||
<div class="well"> | ||
<p> <%= role.name %> | ||
<%= link_to "delete", role, method: :delete, | ||
<div class="row"> | ||
<div class="col-md-6 col-md-offset-3"> | ||
<%= link_to "Create Role", new_role_path %> <br/> | ||
<% @roles.each do |role| %> | ||
<p> <%= role.name %> | ||
<%= link_to "delete", role, method: :delete, | ||
data: {confirm: "Are you sure?"}, | ||
title: role.name %> | ||
|
||
</p> | ||
title: role.name %> </p> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<%= link_to "Create Role", new_role_path %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<h1>Tour index</h1> | ||
<div class="col-md-6 col-md-offset-3"> | ||
<% @tours.each do |tour| %> | ||
<div class="well"> | ||
<p> <%= tour.name %> <%= link_to "Buchen", new_wish_path %> | ||
|
||
<div class="row row-2"> | ||
<div class="col-md-6 col-md-offset-3"> | ||
<% if user_signed_in? && current_user.has_role?('admin') %> | ||
<%= link_to "delete", tour, method: :delete, | ||
data: {confirm: "Are you sure?"}, | ||
title: tour.name %> | ||
<%= link_to "Create tour", new_tour_path %> | ||
<% end %> | ||
<% @tours.each do |tour| %> | ||
<div class="well"> | ||
<p> <%= tour.name %> <%= link_to "Buchen", new_wish_path(tour: tour.name) %> | ||
<% if user_signed_in? && current_user.has_role?('admin') %> | ||
<%= link_to "delete", tour, method: :delete, | ||
data: {confirm: "Are you sure?"}, | ||
title: tour.name %> | ||
<% end %> | ||
</p> | ||
</div> | ||
<% end %> | ||
</p> | ||
</div> | ||
<% end %> | ||
<%= link_to "Create tour", new_tour_path %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,11 @@ | |
describe "email address with mixed case" do | ||
mixed_case_email = "[email protected]" | ||
it "should be saved as all lower-case" do | ||
funny_user = FactoryGirl.create(:user, email: mixed_case_email) | ||
funny_user = FactoryGirl.create(:user) | ||
funny_user.email = mixed_case_email | ||
#require 'pry'; binding.pry | ||
funny_user.confirmed_at = Time.now | ||
funny_user.save | ||
expect(funny_user.reload.email).to eq mixed_case_email.downcase | ||
end | ||
end | ||
|
@@ -94,11 +98,9 @@ | |
specify { expect(admin.roles).to eq [Role.find_by(name: "admin")] } | ||
end | ||
|
||
it "FactoryGirl can create aa Guide at will" do | ||
guide = FactoryGirl.create(:user, :guide) | ||
pp guide.roles | ||
expect(guide.has_role?("guide")).to eq true | ||
|
||
it "FactoryGirl can create a Guide at will" do | ||
guide = FactoryGirl.create(:user, :guide) | ||
expect(guide.has_role?("guide")).to eq true | ||
end | ||
|
||
describe "unsetting a role" do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters