test_selector v0.3.0 TestSelector

Link to this section Summary

Functions

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

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

Generates a unique code for an html element

Example

iex(0)> UserCell.test_selector("avatar")
"user-45e6f-avatar"

It returns the a hash of the module.

Link to this section Functions

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

Examples

iex(0)> 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)

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

Examples

With just a name

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

With both a name and value

iex(0)> 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">
Link to this function

test_selector()

Generates a unique code for an html element

Examples

iex(1)> UserView.test_selector()
"user-45e6f"
Link to this function

test_selector(name)

Example

iex(0)> UserCell.test_selector("avatar")
"user-45e6f-avatar"
Link to this function

test_selector_hash()

It returns the a hash of the module.