public function CommerceCouponTest::testCommerceCouponUIAccessCouponsListing in Commerce Coupon 7.2
Access to commerce discounts admin.
File
- ./
commerce_coupon.test, line 172 - Commerce Coupon tests.
Class
- CommerceCouponTest
- Testing commerce coupon UI and functionality.
Code
public function testCommerceCouponUIAccessCouponsListing() {
// Login with customer.
$this
->drupalLogin($this->store_customer);
// Check the access to the profiles listing.
$this
->drupalGet('admin/commerce/discounts');
$this
->assertResponse(403, 'The store customer has no access to coupon administration.');
// Login with store admin.
$this
->drupalLogin($this->store_admin);
// Check the access to the profiles listing.
$this
->drupalGet('admin/commerce/coupons');
$this
->assertResponse(200, 'The store admin has access to coupon administration.');
// Check the add customer profile link.
$this
->assertRaw(l(t('Create Coupon'), 'admin/commerce/coupons/add'), "'Create Coupon' link is present in the page");
}