-
Notifications
You must be signed in to change notification settings - Fork 1
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 #49 from flippercloud/more-examples
Cleans Up Demo & Examples
- Loading branch information
Showing
9 changed files
with
135 additions
and
48 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
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 |
---|---|---|
@@ -1,7 +1,16 @@ | ||
<footer class="d-flex justify-content-center border-top gap-3 my-5 py-4"> | ||
<span class="fw-bold">View Source</span> | ||
<a target="_blank" rel="noreferrer" class="link-offset-2 link-underline link-underline-opacity-25 icon-link" href="https://github.com/flippercloud/flipper-rails-demo/tree/main/app/views<%= locals[:file].gsub(Rails.root.to_s, '') %>"> | ||
<%= icon 'github' %> | ||
<code><%= locals[:file].gsub(Rails.root.to_s, '') %></code> | ||
</a> | ||
<footer class="d-flex justify-content-between border-top gap-3 my-5 py-4"> | ||
<div class="d-flex justify-content-center gap-2"> | ||
<span class="fw-bold"></span> | ||
<a target="_blank" rel="noreferrer" class="link-offset-2 link-underline link-underline-opacity-25 icon-link" href="/flipper"> | ||
<%= icon 'toggles' %> | ||
Flipper UI | ||
</a> | ||
</div> | ||
<div class="d-flex justify-content-center gap-2"> | ||
<span class="fw-bold">View Source</span> | ||
<a target="_blank" rel="noreferrer" class="link-offset-2 link-underline link-underline-opacity-25 icon-link" href="https://github.com/flippercloud/flipper-rails-demo/tree/main/app/views<%= locals[:file].gsub(Rails.root.to_s, '') %>"> | ||
<%= icon 'github' %> | ||
<code><%= locals[:file].gsub(Rails.root.to_s, '') %></code> | ||
</a> | ||
</div> | ||
</footer> |
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,13 +1,21 @@ | ||
require "test_helper" | ||
|
||
class ExampleControllerTest < ActionDispatch::IntegrationTest | ||
test "should get index" do | ||
test "gets index" do | ||
get examples_url | ||
assert_response :success | ||
end | ||
|
||
test "should get show" do | ||
test "gets show" do | ||
get example_url(slug: 'circuit-breakers') | ||
assert_response :success | ||
end | ||
|
||
test "loads all examples" do | ||
Example.list.each do |ex| | ||
get example_url(slug: ex.slug) | ||
assert_response :success | ||
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 |
---|---|---|
@@ -1,7 +1,32 @@ | ||
require "test_helper" | ||
|
||
class ExampleTest < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
setup do | ||
@example = Example.new( | ||
title: "Example Title", | ||
desc: "Example Description", | ||
icon: "check", | ||
tags: [[:permanent, :success], [:internal, :secondary]] | ||
) | ||
end | ||
|
||
test "auto-generates a flag symbol without a custom_flag" do | ||
assert_equal :example_title, @example.flag | ||
end | ||
|
||
test "prefers custom_flag symbol when provided" do | ||
@example.custom_flag = :example | ||
assert_equal :example, @example.flag | ||
end | ||
|
||
test "creates slug from title" do | ||
assert_equal 'example-title', @example.slug | ||
end | ||
|
||
test "knows if the corresponding partial exists" do | ||
assert_not @example.exists? | ||
|
||
@example.title = "Circuit Breakers" | ||
assert @example.exists? | ||
end | ||
end |