Skip to content

Commit

Permalink
Make sure access controls work. [#70]
Browse files Browse the repository at this point in the history
  • Loading branch information
marnen committed Mar 9, 2018
1 parent 51e6b82 commit aa865c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ defmodule WebSteps do
{:ok, state |> put_in([:session], new_session)}
end

then_ ~r/^I should be on (?<page_name>.+)$/, fn %{session: session} = state, %{page_name: page_name} ->
assert current_path(session) == path_to(page_name)
then_ ~r/^I should (?<negation>not )?be on (?<page_name>.+)$/, fn %{session: session} = state, %{negation: negation, page_name: page_name} ->
expect(current_path(session) == path_to(page_name)).to eq(String.length(negation) == 0)
{:ok, state}
end

then_ ~r/^I should (?<negation>not )?see "(?<text>[^"]+)"$/, fn %{session: session} = state, %{negation: negation, text: text} ->
assert (session |> has_text?(text)) == (String.length(negation) == 0)
expect(session |> has_text?(text)).to eq(String.length(negation) == 0)
{:ok, state}
end

Expand Down
5 changes: 5 additions & 0 deletions phoenix/contraq/features/create_gigs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ Scenario Outline: Basic gig creation
Examples:
| name | start | end | venue | street | city | state | zip |
| My Gig | 2100-12-25 20:00 | 2100-12-25 22:30 | Carnegie Hall | 881 Seventh Avenue | New York | NY | 10019 |

Scenario: Can't create gigs unless logged in
Given I am not logged in
When I go to the new gig page
Then I should not be on the new gig page

0 comments on commit aa865c2

Please sign in to comment.