TestSelector.test

You're seeing just the function test, go back to TestSelector module for more information.

The test function will return both the HTML attribute and it's value.

Examples

iex> UserCell.test()
"test-selector="user-45e6f""

In the user show template:

<a href="#" <%= test() %>>

# results in
<a href="#" test-selector="user-45e6f">
Link to this function

test(name, value \\ nil)

View Source

The test function will return both the HTML attribute and it's value.

Examples

With just a name:

iex> UserCell.test("avatar")
"test-selector="user-45e6f-avatar""

With both a name and value

iex> UserCell.test("id", 13)
"test-selector="user-45e6f-id" test-value="13""

In the user show template:

<a href="#" <%= test("foo") %>>
<a href="#" <%= test("foo", "bar") %>>

<a href="#" test-selector="<%= test_selector("foo") %>">
<a href="#" test-selector="<%= test_selector("foo") %> test-value="bar">