Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Or install it yourself with:

[💌  Subscribe](https://blog.flippercloud.io/#/portal/signup) - we'll send you short and sweet emails when we release new versions ([examples](https://blog.flippercloud.io/tag/releases/)).

## Merch

Do you deploy on Fridays? [👕 Get the tee](https://shop.verygoodsoftware.company/product/i-deploy-on-fridays-tee?utm_source=oss&utm_medium=readme&utm_campaign=merch).

## Getting Started

Use `Flipper#enabled?` in your app to check if a feature is enabled.
Expand Down
4 changes: 4 additions & 0 deletions lib/flipper/ui/views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
<li class="nav-item ms-auto text-muted small">
<a href="https://www.flippercloud.io/docs/ui?utm_source=oss&utm_medium=ui&utm_campaign=docs">Docs</a>
&bull;
<% if Flipper::UI.configuration.fun %>
<a href="https://shop.verygoodsoftware.company/product/i-deploy-on-fridays-tee?utm_source=oss&utm_medium=ui&utm_campaign=merch" title="Do you deploy on Fridays?">Shirt</a>
&bull;
<% end %>
Version: <%= Flipper::VERSION %>
</li>
</ul>
Expand Down
30 changes: 30 additions & 0 deletions spec/flipper/ui/actions/features_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,36 @@
end
end

context "merch callout" do
before do
@original_fun_enabled = Flipper::UI.configuration.fun
Flipper::UI.configuration.fun = fun_mode
get '/features'
end

after do
Flipper::UI.configuration.fun = @original_fun_enabled
end

context "when fun mode is enabled" do
let(:fun_mode) { true }

it 'renders the shirt link' do
expect(last_response.body).to include('>Shirt</a>')
expect(last_response.body).to include('i-deploy-on-fridays-tee')
end
end

context "when fun mode is disabled" do
let(:fun_mode) { false }

it 'does not render the shirt link' do
expect(last_response.body).not_to include('>Shirt</a>')
expect(last_response.body).not_to include('i-deploy-on-fridays-tee')
end
end
end

context "when in read-only mode" do
before { allow(flipper).to receive(:read_only?) { true } }

Expand Down