forked from nodunayo/speakerline
-
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.
Merge pull request nodunayo#567 from hilarysk/hilarysk/issue-147-grac…
…efully-handle-non-existent-tags Issue nodunayo#147 - Gracefully handle non-existent tags
- Loading branch information
Showing
9 changed files
with
82 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<% tags_columns = @tags.in_groups(4, false) %> | ||
|
||
<p>New tags are created by adding them to a proposal.</p> | ||
|
||
<div class="row"> | ||
<div class="three columns"> | ||
<% tags_columns[0].each do |tag| %> | ||
<p><%= link_to "##{tag.name}", tag_path(tag.name) %></p> | ||
<% end %> | ||
</div> | ||
|
||
<div class="three columns"> | ||
<% tags_columns[1].each do |tag| %> | ||
<p><%= link_to "##{tag.name}", tag_path(tag.name) %></p> | ||
<% end %> | ||
</div> | ||
|
||
<div class="three columns"> | ||
<% tags_columns[2].each do |tag| %> | ||
<p><%= link_to "##{tag.name}", tag_path(tag.name) %></p> | ||
<% end %> | ||
</div> | ||
|
||
<div class="three columns"> | ||
<% tags_columns[3].each do |tag| %> | ||
<p><%= link_to "##{tag.name}", tag_path(tag.name) %></p> | ||
<% end %> | ||
</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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe TagsController do | ||
describe 'GET #index' do | ||
context 'when viewing the Tags#index page' do | ||
before do | ||
create(:tag, name: "ruby") | ||
create(:tag, name: "python") | ||
create(:tag, name: "activerecord") | ||
|
||
get :index | ||
end | ||
|
||
it 'lists the tags in alphabetical order' do | ||
expect(assigns(:tags).pluck(:name)).to eq ["activerecord", "python", "ruby"] | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FactoryBot.define do | ||
factory :tag, class: ActsAsTaggableOn::Tag do | ||
name { Faker::Name.name } | ||
end | ||
end |